'build' w/ node.js preset doesn't generate a running application in Node v16 LTS
See original GitHub issueEnvironment
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: `yarn@1.22.17`
- 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
Logs
error: Uncaught TypeError: false.accept is not a function
at entry-51da4355.mjs:1
(anonymous) @ entry-51da4355.mjs:1
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Looks like i have a similar error.
bootstrap-8042a496.mjs:8 Uncaught TypeError: false.accept is not a function at bootstrap-8042a496.mjs:8 (anonymous) @ bootstrap-8042a496.mjs:8
i tried quite hard to reproduce the problem, after 3 days i found the solution. my .env contained the variable NODE_ENV=DEBUG this somehow conflicts with the prod build yarn build
Nuxt project info:
Linux
v16.13.1
3.0.0-27338323.1e98259
yarn@1.22.10
Vite
buildModules
,publicRuntimeConfig
-
nuxt-windicss@2.2.2
A permanent fix has been introduced: https://github.com/nuxt/framework/pull/5417.
Regardless, you should not override NODE_ENV.