next.js: Error: Cannot find module '.next\server\pages-manifest.json'
Bug report
Describe the bug
When starting in dev mode, this error occurs when I try to navigate to the page in the browser
Screenshots
{ Error: Cannot find module 'C:\core\.next\server\pages-manifest.json'
> Building page: /_error
WAIT at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
Compiling...15:26:08 at Function.Module._load (internal/modules/cjs/loader.js:535:25)
at Module.require (internal/modules/cjs/loader.js:663:17)
at require (internal/modules/cjs/helpers.js:20:18)
at getPagePath (C:\core\node_modules\next-server\dist\server\require.js:14:27)
at Object.requirePage (C:\core\node_modules\next-server\dist\server\require.js:30:22)
at Object.loadComponents (C:\core\node_modules\next-server\dist\server\load-components.js:15:34)
at DevServer.renderToHTMLWithComponents (C:\core\node_modules\next-server\dist\server\next-server.js:196:48)
at DevServer.renderToHTML (C:\core\node_modules\next-server\dist\server\next-server.js:202:37)
at DevServer.renderToHTML (C:\core\node_modules\next\dist\server\next-dev-server.js:101:22)
at processTicksAndRejections (internal/process/next_tick.js:81:5) code: 'MODULE_NOT_FOUND' }
System information
- OS: [Windows 10 ]
- Browser [chrome]
- Version of Next.js: [ 8.0.1]
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 10
- Comments: 18 (9 by maintainers)
Sure. Nothing happens
I am going to take a wild guess: I think this happens when webpack build fails. It is unable to write the manifest file and then next.js is unable to read it.
I’m going to try to reproduce @aricma 's report and see if the error can be displayed in a better way.
in my case it was an open link tag in _document.js
using
"next": "^8.0.1"// build failed
// build succeeded
fwiw, I just ran into this and deleting my .next and node_modules, then
npm installthen runningnpm run devfixed it for meI had the same problem. I removed
serverless: trueoption in thenext.config.jsfile and it helped me.Have any of you had any luck with this? I’m also having the same issue. Even tried running without my custom
_appand_documentand it still didn’t work. Removing theserverlessoption makes the production version work fine.~Getting this error. Should I take the latest canary release?~ Somehow restarted server, deleted .next cache a couple of times and the error went away.