Home

Issue: 1265

Babel? Error in ./.nuxt/index.js Syntax Error: Unexpected token (92:4) ...App

[issue link]

Noob… I was doing fine, then think I npm updated… now Babel messed up.

npm run dev

` ERROR Failed to compile with 2 errors 5:32:57 PM

error in ./.nuxt/index.js

Syntax Error: Unexpected token (92:4)

90 | }
91 | },

92 | …App
| ^
93 | }
94 |
95 | const next = ssrContext ? ssrContext.next : location => app.router.push(location)

@ ./.nuxt/client.js 13:13-31
@ multi webpack-hot-middleware/client?name=$client&reload=true ./.nuxt/client.js

error in ./.nuxt/utils.js

Syntax Error: Unexpected token (26:13)

24 | asyncData = this.$ssrContext.asyncData[Component.options.name]
25 | }

26 | return { …data, …asyncData }
| ^
27 | }
28 | if (Component._Ctor && Component._Ctor.options) {
29 | Component._Ctor.options.data = Component.options.data

@ ./.nuxt/client.js 15:13-31
@ multi webpack-hot-middleware/client?name=$client&reload=true ./.nuxt/client.js`

I’ve tried 15 different versions of Babel configs… I saw that the ‘latest’ had changed: https://nuxtjs.org/guide/release-notes/#improvements
"Add babel-preset-es2015 in dependencies to avoid error with some external libraries"

And I tried diddling the .babelrc file… and then adding it in nuxt.config.js
build: { babel: { "presets": ["es2015"] },

Still no joy. And all was working fine just yesterday…

It started when it could not find my ~components… but I think I managed to fix that but now the babel config seems screwed.

``

Anyone have any ideas? I’ve been loving the Nuxt.js experience till now.

This question is available on Nuxt.js community (#c1120)