Skip to content

Fetching on client side not working for child routes with Nuxtjs. #212

@UnGast

Description

@UnGast

I have the following routes:

{ path: '/location', component: Parent, children: [ { path: ':slug', component: Child } ] }

When a slug is given, the child component should load and display some data.
When I directly open Child (/location/someslug) and the data is prefetched on server side, everything works. But when accessing Parent (/location), and then navigating to Child I get this error:

vue-apollo.esm.js:2977 Uncaught TypeError: Cannot read property 'loading' of undefined at SmartQuery.get$$1 (vue-apollo.esm.js:2977) at SmartQuery.loadingDone (vue-apollo.esm.js:2881) at SmartQuery.nextResult (vue-apollo.esm.js:2828) at SubscriptionObserver.next (zen-observable.js:158) at ObservableQuery.js:322 at Array.forEach (<anonymous>) at Object.next (ObservableQuery.js:322) at QueryManager.js:355 at QueryManager.js:654 at Array.forEach (<anonymous>)

The error only happens when accessing the child for the first time. After that all navigations work.
I'm using nuxtjs/apollo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions