Skip to content

'build' w/ node.js preset doesn't generate a running application in Node v16 LTS #12772

@Zizaco

Description

@Zizaco

Environment

npx nuxi info
Nuxt CLI v3.0.0-27277498.850ef69
Nuxt project info: 

------------------------------
- Operating System: `Linux`
- Node Version:     `v16.13.0`
- Nuxt Version:     `3.0.0-27277498.850ef69`
- Package Manager:  `[email protected]`
- Bundler:          `Vite`
- User Config:      `-`
- Runtime Modules:  `-`
- Build Modules:    `-`
------------------------------

Reproduction

Stackblitz link:
https://stackblitz.com/edit/github-fchd76?devtoolsheight=33&file=THEBUG.md

⚠️ But the error is not visible in Stackblitz, because it doesn't run the LTS version of node. Stackblitz is stuck in node v14

Steps to reproduce bug:

Use node.js 16.13.0 LTS
The bug happens only when the "build" command runs on node 16.13.0 LTS

Build project normally (with node.js preset):
(This doesn't generate any errors)

npm run build

Run application that was built

npm run start
# node .output/server/index.mjs # also works

Simply open the application on the browser.

Check console:

error: Uncaught TypeError: false.accept is not a function at entry-51da4355.mjs:1
(anonymous) @ entry-51da4355.mjs:1

I've reproduced it with nodejs v16.13.0 LTS. It doesn't happen with nodejs v14.18.1 🔥

Describe the bug

Whenever the build command is run with node v16.13.0 LTS, the shipped .output doesn't run properly.

When running node .output/server/index.mjs, the browser application crashes on a javascript error that blocks any hydration to take place:

error: Uncaught TypeError: false.accept is not a function
  at entry-51da4355.mjs:1
(anonymous) @ entry-51da4355.mjs:1

Additional context

Bug screenshot

Logs

error: Uncaught TypeError: false.accept is not a function
  at entry-51da4355.mjs:1
(anonymous) @ entry-51da4355.mjs:1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions