nuxt / website-v2

Nuxt 2 Documentation Website
https://v2.nuxt.com
Other
2.25k stars 1.19k forks source link

Started a new Nuxt.js project, yarn dev or npm run dev gives me a SyntaxError #118

Closed acidjazz closed 6 years ago

acidjazz commented 6 years ago
yarn run v1.3.2
$ nuxt
/Users/k/sake-new/node_modules/nuxt/lib/core/middleware/nuxt.js:72
      const policies = this.options.render.csp.policies ? {...this.options.render.csp.policies} : null
                                                           ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/k/sake-new/node_modules/nuxt/lib/core/renderer.js:19:24)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
acidjazz commented 6 years ago

doing some digging it seems that this.options.render is null

acidjazz commented 6 years ago

Here is the logs of starting a nuxt.js project from scratch and still getting the error


 ▲ ~/code vue init nuxt-community/starter-template nuxt-test

  A newer version of vue-cli is available.

  latest:    2.9.3
  installed: 2.9.2

? Project name nuxt-test
? Project description Nuxt.js project
? Author kevin olson <acidjazz@gmail.com>

   vue-cli · Generated "nuxt-test".

   To get started:

     cd nuxt-test
     npm install # Or yarn
     npm run dev

 ▲ ~/code cd nuxt-test
 ▲ ~/code/nuxt-test ls -la
total 24
drwxr-xr-x 16 k staff 512 Mar  6 14:48 .
drwxr-xr-x 21 k staff 672 Mar  6 14:48 ..
-rw-r--r--  1 k staff 207 Mar  6 14:48 .editorconfig
-rw-r--r--  1 k staff 484 Mar  6 14:48 .eslintrc.js
-rw-r--r--  1 k staff  92 Mar  6 14:48 .gitignore
-rw-r--r--  1 k staff 397 Mar  6 14:48 README.md
drwxr-xr-x  3 k staff  96 Mar  6 14:48 assets
drwxr-xr-x  4 k staff 128 Mar  6 14:48 components
drwxr-xr-x  4 k staff 128 Mar  6 14:48 layouts
drwxr-xr-x  3 k staff  96 Mar  6 14:48 middleware
-rw-r--r--  1 k staff 813 Mar  6 14:48 nuxt.config.js
-rw-r--r--  1 k staff 610 Mar  6 14:48 package.json
drwxr-xr-x  4 k staff 128 Mar  6 14:48 pages
drwxr-xr-x  3 k staff  96 Mar  6 14:48 plugins
drwxr-xr-x  4 k staff 128 Mar  6 14:48 static
drwxr-xr-x  3 k staff  96 Mar  6 14:48 store
 ▲ ~/code/nuxt-test yarn
yarn install v1.3.2
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 16.94s.
 ▲ ~/code/nuxt-test yarn dev
yarn run v1.3.2
$ nuxt
/Users/k/code/nuxt-test/node_modules/nuxt/lib/core/middleware/nuxt.js:72
      const policies = this.options.render.csp.policies ? {...this.options.render.csp.policies} : null
                                                           ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/k/code/nuxt-test/node_modules/nuxt/lib/core/renderer.js:19:24)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
 △ ~/code/nuxt-test
acidjazz commented 6 years ago

sorry wrong place for this bug