vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.36k stars 26.77k forks source link

Getting "Error: Cannot find module '/app/.next/server/font-manifest.json'" on production build #24605

Closed ghost closed 2 years ago

ghost commented 3 years ago

What version of Next.js are you using?

10.2.0

What version of Node.js are you using?

12.20.0

What browser are you using?

Chrome

What operating system are you using?

Ubuntu

How are you deploying your application?

Code Build

Describe the Bug

I am getting the following error on 10.2, working on 10.1.3

ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5 Error: Cannot find module '/app/.next/server/font-manifest.json'

The font-manifest.json does not exist after a build. This happens on a fresh build in our CD pipeline.

Is there something needed to migrate to v 10.2?

Expected Behavior

The server should stay up at port 3000

To Reproduce

Just build and serve the current codebase.

timneutkens commented 3 years ago

Just build and serve the current codebase.

Just build your application? How 🤔

PavelDemyanenko commented 3 years ago

Same issue for me:

ready - started server on 0.0.0.0:8080, url: http://localhost:8080
info - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5
Error: Cannot find module '/web/.next/server/font-manifest.json'
Require stack:
- /web/node_modules/next/dist/next-server/server/require.js
- /web/node_modules/next/dist/next-server/server/load-components.js
- /web/node_modules/next/dist/next-server/server/api-utils.js
- /web/node_modules/next/dist/next-server/server/next-server.js
- /web/node_modules/next/dist/server/next.js
- /web/node_modules/next/dist/server/lib/start-server.js
- /web/node_modules/next/dist/cli/next-start.js
- /web/node_modules/next/dist/bin/next
ghost commented 3 years ago

@timneutkens for some inexplicable reason, the issue is not happening anymore, even I just re-ran a failing deploy task, and seems to be working now, I think something broke in the package versions downloaded from npm between yesterday around this time and today. As it randomly started to happen it went away for me...

timneutkens commented 3 years ago

@PavelDemyanenko @grnwld please provide a reproduction, these comments are not useful and will not help with solving the issue you're running into.

cherepanov commented 3 years ago

the same after update to 10.1.3 => 10.2.0. workaround is to disable font processing via config

optimizeFonts: false,
DarkCode01 commented 3 years ago

i have the same issues, i deploy the app using dokku.

Screen Shot 2021-05-04 at 11 46 03 AM

DarkCode01 commented 3 years ago

the same after update to 10.1.3 => 10.2.0. workaround is to disable font processing via config

optimizeFonts: false,

Tha fix it 👍🏽

timneutkens commented 3 years ago

Again, please provide a reproduction for your particular issue so that it can be investigated.

lxn07122945 commented 3 years ago

the same after update to 10.1.3 => 10.2.0. workaround is to disable font processing via config

optimizeFonts: false,
lxn07122945 commented 3 years ago

I want to know reason

timneutkens commented 2 years ago

Closing as no reproduction was provided.

balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.