nuxt-webpack-optimisations icon indicating copy to clipboard operation
nuxt-webpack-optimisations copied to clipboard

Error on startup: SyntaxError: Invalid or unexpected token

Open VladStepanov opened this issue 2 years ago • 3 comments

Describe the bug When i installed plugin and start app, i get an error

To Reproduce Steps to reproduce the behavior:

  1. install via yarn.
  2. Add to nuxt.config.js installation below
  3. try to npm run dev

Expected behavior To build and work

Screenshots image

Additional context Nuxt version 2.14.11. No bridge to v3. Firstly got an error on node@14, therefore i updated to node@18, but this does't help Installation:

buildModules: [
    'nuxt-webpack-optimisations'
]

VladStepanov avatar Nov 16 '22 09:11 VladStepanov

Hey, thanks for the issue. Could you try with node 16, otherwise what is the error in node 18?

The code it's flagging isn't from my code, but the @nuxt/kit, so not too much I can do about it.

harlan-zw avatar Nov 16 '22 09:11 harlan-zw

@harlan-zw Tried with node@16 image Same thing

VladStepanov avatar Nov 16 '22 09:11 VladStepanov

It looks like the problem is with optional chaining, but node@18 already have native support for optional chaining

VladStepanov avatar Nov 16 '22 09:11 VladStepanov