harlan-zw / nuxt-webpack-optimisations

Make your Nuxt.js webpack builds faster ⚡
269 stars 8 forks source link

Error on startup: SyntaxError: Invalid or unexpected token #41

Open VladStepanov opened 1 year ago

VladStepanov commented 1 year ago

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'
]
harlan-zw commented 1 year ago

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.

VladStepanov commented 1 year ago

@harlan-zw Tried with node@16

image

Same thing

VladStepanov commented 1 year ago

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