question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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:  `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

Bug screenshot

Logs

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
andreas83commented, Jan 7, 2022

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:

  • Operating System: Linux
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-27338323.1e98259
  • Package Manager: yarn@1.22.10
  • Bundler: Vite
  • User Config: buildModules, publicRuntimeConfig
  • Runtime Modules: -
  • Build Modules: nuxt-windicss@2.2.2

0reactions
danielroecommented, Jul 5, 2022

A permanent fix has been introduced: https://github.com/nuxt/framework/pull/5417.

Regardless, you should not override NODE_ENV.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up a Node development environment - MDN Web Docs
In Node/Express a web application creates and runs its own web server! ... To create an Express app named "helloworld" with the default...
Read more >
create-react-app says "Create React App requires Node 14 or ...
To create a react app using the command npx create-react-app my-app ... nodejs rm -rf ~/.nvm sudo apt-get install nvm nvm install --lts...
Read more >
Process | Node.js v19.3.0 Documentation
js process will exit when there is no work scheduled, but a listener registered on the 'beforeExit' event can make asynchronous calls, and...
Read more >
Heroku Node.js Support
Reference documentation describing the the support for Node.js on Heroku's Cedar stack.
Read more >
npm does not support node.js v16.14.2 - You.com
I'm thinking that if we build with it, ICU data should be moved in-tree so the build does not rely on external downloads....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found