Skip to content
This repository was archived by the owner on Nov 26, 2021. It is now read-only.

Nuxt + Vuex parent.getChild(...) is undefined #758

Closed
olddeda opened this issue Nov 16, 2019 · 2 comments
Closed

Nuxt + Vuex parent.getChild(...) is undefined #758

olddeda opened this issue Nov 16, 2019 · 2 comments
Labels

Comments

@olddeda
Copy link

olddeda commented Nov 16, 2019

  • Vue.js version: 2.6.10
  • Nuxt.js version: 2.10.2

nuxt.config.js

plugins: [
....
  {
    src: "~plugins/vue-tables-2.js",
    ssr: true, //or false, the same
  },
....

/plugins/vue-tables-2.js

import {
    ServerTable
} from 'vue-tables-2'

export default ({
    app: {
        $axios,
    },
}, inject) => {
    Vue.use(ServerTable, {
        requestFunction(data) {
            return $axios.get(this.url, {
                params: data
            }).catch(function(e) {
                this.dispatch('error', e)
            }.bind(this))
        }
    }, true);
}

Admin.vue

<template>
....
<v-server-table
  name="item"
  url="/api/contents"
  :columns="columns"
  :options="options"></v-server-table>
....

Error:

TypeError: "parent.getChild(...) is undefined"
    unregister vuex.esm.js:217
    unregisterModule vuex.esm.js:505
    unregisterModule eval:1
    exports register-module.js:23
    exports created.js:9
    created v-server-table.js:61
    VueJS 68
    NuxtJS 2
    tryCatch runtime.js:45
    invoke runtime.js:271
    method runtime.js:97
    node_modules asyncToGenerator.js:5
    node_modules asyncToGenerator.js:27
client.js:77

@VladZen
Copy link

VladZen commented May 8, 2020

Possibly can be connected to #832
and vuejs/vue2-ssr-docs#166

@stale
Copy link

stale bot commented Jan 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 30, 2021
@stale stale bot closed this as completed Feb 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants