LookinGit / nuxt-asyncdatas-example

Reproduction error asyncDatas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nuxt-asyncdatas-example

For reproduction of error, need:

  • npm run build
  • npm start

On user info page asyncData.city - undefined, and an error occurs Cannot read property 'name' of undefined

AsyncData for component not applicable, because in production build no name components, if you don't set them manually

Solution

To resolve this problem, necessary changes from commit

Build Setup

# install dependencies
$ npm install # Or yarn install*[see note below]

# serve with hot reload at localhost:3000
$ npm run dev

# build for production and launch server
$ npm run build
$ npm start

# generate static project
$ npm run generate

*Note: Due to a bug in yarn's engine version detection code if you are using a prerelease version of Node (i.e. v7.6.0-rc.1) you will need to either:

  1. Use npm install
  2. Run yarn with a standard release of Node and then switch back

For detailed explanation on how things work, checkout the Nuxt.js docs.

About

Reproduction error asyncDatas


Languages

Language:Vue 61.2%Language:JavaScript 32.3%Language:CSS 6.5%