davidroyer / nuxt-api-example

Nuxt.js API Example using Vuex and axios
https://nuxt-api-example.netlify.com/
123 stars 25 forks source link

TypeError: Cannot read property 'push' of undefined #2

Open magick93 opened 6 years ago

magick93 commented 6 years ago

When I run npm run dev I get the following errors:

❯ npm run dev

> nuxt-api-example@1.0.0 dev /home/anton/git/nuxt-api-example
> nuxt

 ERROR  Nuxt error

  TypeError: Cannot read property 'push' of undefined

and

 ERROR  Failed to compile with 3 errors                                    10:41:23

These dependencies were not found:

* ~components/Header.vue in ./node_modules/babel-loader/lib?{"babelrc":false,"cacheDirectory":true,"presets":[["/home/anton/git/nuxt-api-example/node_modules/babel-preset-vue-app/dist/index.common.js",{"targets":{"ie":9,"uglify":true}}]]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./layouts/default.vue
* ~plugins/axios.js in ./store/index.js
* ~static/markdownFiles/HomeContent.md in ./node_modules/babel-loader/lib?{"babelrc":false,"cacheDirectory":true,"presets":[["/home/anton/git/nuxt-api-example/node_modules/babel-preset-vue-app/dist/index.common.js",{"targets":{"ie":9,"uglify":true}}]]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./pages/index.vue

To install them, you can run: npm install --save ~components/Header.vue ~plugins/axios.js ~static/markdownFiles/HomeContent.md
dev7ch commented 6 years ago

I experienced the same and solved it like that:

1.) use the latest version of markdownit in your package.json change to"@nuxtjs/markdownit": "latest", (v.1.2.1 is the latest one)

2.) replace all dependency load paths like ~components/Header.vue with ~/components/Header.vue or better @/components/Header.vue .. it's basicly the missing / i guess