Skip to content

Nuxt support #2

Open
Open
@sobolevn

Description

@sobolevn
  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [x] question about how to use this project

I have this page component in nuxt:

@Component({})
export default class Index extends mixins(TypedStoreMixin) {
  fetch ({ store }: { store }): Promise<RawCommentType[]> {
    // Here we don't have a DI setup yet, so we use the explicit approach:
    const typedStore = useStore<TypedStore>(store)
    return typedStore.comments.fetchComments()
  }

  fetchComments () {
    this.typedStore.comments.fetchComments()
  }
}

When I use fetch method from Nuxt I see this error:

Cannot determine a class of the requesting service "function TestService() {}"

Снимок экрана 2019-06-23 в 15 29 50

But, if fetch is not used and I instead use fetchComments method on button click - it works fine.

I guess the reason is that nuxt handles fetch differently and something is not setup properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions