Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unexpected token '||=' #15203

Closed
bitsnaps opened this issue Oct 19, 2022 · 3 comments
Closed

Error: Unexpected token '||=' #15203

bitsnaps opened this issue Oct 19, 2022 · 3 comments

Comments

@bitsnaps
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v14.18.3
  • Nuxt Version: 3.0.0-rc.12
  • Nitro Version: -
  • Package Manager: pnpm@7.6.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Create new project using nuxi

Describe the bug

Got an error: Unexpected token '||=' on start up.

Additional context

No response

Logs

Nuxi 3.0.0-rc.12                                                                                              22:19:40
Nuxt 3.0.0-rc.12 with Nitro 0.6.0                                                                             22:19:40
                                                                                                              22:19:41
  > Local:    http://localhost:3000/ 
  > Network:  http://192.168.1.2:3000/

ℹ Vite client warmed up in 2312ms                                                                             22:19:45
✔ Nitro built in 1640 ms                                                                                nitro 22:19:46
[nuxt] [request error] [unhandled] [500] Unexpected token '||='
@bitsnaps
Copy link
Author

According to @danielroe , this issue is related to node version, I need to upgrade node to >= 15, it'll be fixed in future releases.

@SPH73
Copy link

SPH73 commented Oct 31, 2022

Environment

  • Operating System: Darwin
  • Node Version: v14.18.3
  • Nuxt Version: 3.0.0-rc.12
  • Nitro Version: -
  • Package Manager: pnpm@7.6.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Create new project using nuxi

Describe the bug

Got an error: Unexpected token '||=' on start up.

Additional context

No response

Logs

Nuxi 3.0.0-rc.12                                                                                              22:19:40
Nuxt 3.0.0-rc.12 with Nitro 0.6.0                                                                             22:19:40
                                                                                                              22:19:41
  > Local:    http://localhost:3000/ 
  > Network:  http://192.168.1.2:3000/

ℹ Vite client warmed up in 2312ms                                                                             22:19:45
✔ Nitro built in 1640 ms                                                                                nitro 22:19:46
[nuxt] [request error] [unhandled] [500] Unexpected token '||='

I have not changed my node version - I am running 14.18.1. I have this exact error after installing nuxi globally using pnpm. Prior to that when I ran the dev server in rc.12 there were no errors at all.

***However, if I downgrade to rc.11 the dev server starts without the error.

Can anyone help me to uninstall the globally installed nuxi? '''pnpm uninstall nuxi --global''' doesn't seem to work.

@bitsnaps
Copy link
Author

I have not changed my node version - I am running 14.18.1. I have this exact error after installing nuxi globally using pnpm. Prior to that when I ran the dev server in rc.12 there were no errors at all.

This is related to the build script as -for now- it is only supported on node 15+ because of Logical OR assignment (||=), I guess this behavior is fixed in the edge channel, or in the next RC #15250 .

Can anyone help me to uninstall the globally installed nuxi? '''pnpm uninstall nuxi --global''' doesn't seem to work.

I used to uninstall global binaries with npm instead of pnpm for some reasons..., I think nuxi is not supposed to be installed globally, otherwise can you share the the output of npm uninstall nuxi --global.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants