-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Docusaurus fails to build with node v23 #10684
Comments
I'm running these exact commands using Node 23.2 on Sequoia 15.0.1 and can't reproduce 🤷♂️ Are you sure you obtained the error message this way? Can you try on another non-tmp folder?
This warning seems suspicious. Are you using a custom NODE_OPTIONS env variable with experimental options? |
Thanks for the quick response Sébastien! This issue happens to me in ~ as well (attaching Terminal output below). This warning is because Node.js 23 unflagged --experimental-require-module which causes the warning when ESM files are loaded. It appears other popular open sources (like tailwind) are having issues w node23 as well: tailwindlabs/tailwindcss#14818. ➜ ~ node --version
v23.2.0
➜ ~ npx create-docusaurus@latest my-website classic
(node:38323) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
✔ Which language do you want to use? › JavaScript
[INFO] Creating new Docusaurus project...
[INFO] Installing dependencies with npm...
(node:38355) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
added 1216 packages, and audited 1217 packages in 41s
310 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[SUCCESS] Created my-website.
[INFO] Inside that directory, you can run several commands:
`npm start`
Starts the development server.
`npm run build`
Bundles your website into static files for production.
`npm run serve`
Serves the built website locally.
`npm run deploy`
Publishes the website to GitHub pages.
We recommend that you begin by typing:
`cd my-website`
`npm start`
Happy building awesome websites!
➜ ~ cd my-website
➜ my-website npm run build
> [email protected] build
> docusaurus build
[INFO] [en] Creating an optimized production build...
● Client █████████████████████████ building (13%) 0/1 entries 1725/1725 dependencies 302/548 modules 245 active
css-loader › postcss-loader › node_modules/@docusaurus/theme-classic/lib/theme/DocSidebarItem/Link/styles.module.css
✖ Server
Compiled with some errors in 4.14s
✖ Client
Compiled with some errors in 6.20s
✖ Server
[ERROR] Client bundle compiled with errors therefore further build is impossible.
Unexpected end of JSON input
--------------------------
Unexpected end of JSON input
--------------------------
Unexpected end of JSON input
--------------------------
Unexpected end of JSON input
--------------------------
Unexpected end of JSON input
--------------------------
Unexpected end of JSON input |
I just ran the following and got an empty result: ➜ my-website set | grep NODE_OPTIONS
➜ my-website set | grep NODE
➜ my-website set | grep -i NODE
➜ my-website |
Ah yes, my bad I was on v22.3 😅 I can also reproduce with v23.2 now |
webpack/webpack#18963, nodejs/node#55826 This is a Node regression that will be fixed! |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Following the guide at https://docusaurus.io/docs/installation fails with node23.
Reproducible demo
No response
Steps to reproduce
Expected behavior
Project builds successfully
Actual behavior
Project fails to build with the following error:
Your environment
Self-service
The text was updated successfully, but these errors were encountered: