-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Could not find a production build in the '.next' directory on Node.js 23 #1021
Comments
Cannot reproduce the error on code sandbox, please provide a minimal reproduction to your issue |
This comment has been minimized.
This comment has been minimized.
Please submit a reproduction if you have similar problems |
My steps to reproduce are the exact same ones he sent in his submit |
You need to produce the problem in a repo or code sandbox |
I dont know of any code sandbox that i can share with you, so i have created a repo https://github.com/IMXNOOBX/fumadocs-issue-1021 |
Cant reproduce either in the codesandbox, but on a linux server you get the same issue, im sorry i cannot be of more help, but i suggest you try on any other machine you dont use for dev and try it, ive tried in 3 diferent windows machines and in a ubuntu server 22 redacted@redacted:~/github/fumadocs-issue-1021$ node -v
v23.0.0 redacted@redacted:~/github$ git clone https://github.com/IMXNOOBX/fumadocs-issue-1021
Cloning into 'fumadocs-issue-1021'...
remote: Enumerating objects: 31, done.
remote: Counting objects: 100% (31/31), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 31 (delta 0), reused 31 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (31/31), 53.98 KiB | 26.99 MiB/s, done.
redacted@redacted:~/github$ cd fumadocs-issue-1021/
redacted@redacted:~/github/fumadocs-issue-1021$ npm i
(node:3256662) ExperimentalWarning: 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)
> [email protected] postinstall
> fumadocs-mdx
[MDX] types generated
added 390 packages, and audited 391 packages in 9s
160 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
redacted@redacted:~/github/fumadocs-issue-1021$ npm run build
> [email protected] build
> next build
▲ Next.js 15.0.2
- Experiments (use with caution):
· turbo
Creating an optimized production build ...
[MDX] initialized map file
(node:3256858) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Unable to snapshot resolve dependencies
redacted@redacted:~/github/fumadocs-issue-1021$ npm run start
> [email protected] start
> next start
▲ Next.js 15.0.2
- Local: http://localhost:3000
✓ Starting...
Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at setupFsCheck (/home/redacted/github/fumadocs-issue-1021/node_modules/next/dist/server/lib/router-utils/filesystem.js:149:19)
at async initialize (/home/redacted/github/fumadocs-issue-1021/node_modules/next/dist/server/lib/router-server.js:65:23)
at async Server.<anonymous> (/home/redacted/github/fumadocs-issue-1021/node_modules/next/dist/server/lib/start-server.js:266:36)
redacted@redacted:~/github/fumadocs-issue-1021$ node -v
v23.0.0 |
could you degrade node.js to v22 and use pnpm, and see if the problem exists? |
Seems to work with node v22, no pnpm used in this test redacted@redacted:~/github/fumadocs-issue-1021$ nvm install v22
Downloading and installing node v22.11.0...
Downloading https://nodejs.org/dist/v22.11.0/node-v22.11.0-linux-arm64.tar.xz...
################################################################################################################################################################################################ 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v22.11.0 (npm v10.9.0)
redacted@redacted:~/github/fumadocs-issue-1021$ node -v
v22.11.0
redacted@redacted:~/github/fumadocs-issue-1021$ npm ci
> [email protected] postinstall
> fumadocs-mdx
[MDX] types generated
added 390 packages, and audited 391 packages in 9s
160 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
redacted@redacted:~/github/fumadocs-issue-1021$ rm .next -R
redacted@redacted:~/github/fumadocs-issue-1021$ npm run build
> [email protected] build
> next build
▲ Next.js 15.0.2
- Experiments (use with caution):
· turbo
Creating an optimized production build ...
[MDX] initialized map file
(node:3262628) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (7/7)
✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 171 B 109 kB
├ ○ /_not-found 897 B 101 kB
├ ƒ /api/search 137 B 100 kB
└ ● /docs/[[...slug]] 11.3 kB 158 kB
├ /docs
└ /docs/test
+ First Load JS shared by all 99.9 kB
├ chunks/215-429da4f3e8265a89.js 45.2 kB
├ chunks/4bd1b696-89a6990571457db2.js 52.6 kB
└ other shared chunks (total) 2.07 kB
○ (Static) prerendered as static content
● (SSG) prerendered as static HTML (uses generateStaticParams)
ƒ (Dynamic) server-rendered on demand
redacted@redacted:~/github/fumadocs-issue-1021$ npm run start
> [email protected] start
> next start
▲ Next.js 15.0.2
- Local: http://localhost:3000
✓ Starting...
✓ Ready in 499ms |
My thought is there's some compatibility issues with Next.js and Node.js 23. Fumadocs is only a library on top of Next.js so we cannot fix this unless the upstream problem get fixed. For now, I recommend to use Node.js 22 as a solution. |
Alright, thanks for your time! |
To Reproduce
Create a new app
npm create fumadocs-app
Move to the directory
cd test-app
Execute build command
npm run build
Execute start command
npm run start
Current vs. Expected behavior
Following the previous steps it should start the project and host it on port :3000, but it fails stating that next is unable to find the build directory. You dont encounter this issue when running in development mode.
Provide environment information
Which area(s) are affected? (Select all that apply)
Core, CLI (create-fumadocs-app)
Additional context
This issue has been encountered in these OS: Windows 11 23H2 / 10, Linux (Ubuntu 22.04.4 LTS), it happened when migrating from the older
"fumadocs-core": "13.4.10",
,"next": "^14.2.8",
version to the latest one.The text was updated successfully, but these errors were encountered: