Error: Cannot find module '/path/.next/build-manifest.json'
See original GitHub issueBug report
Describe the bug
When a SASS error happens, the Next CLI properly tells me about the SASS error, but then it prints this error to the console every few seconds until I fix the SASS error:
{ Error: Cannot find module '/Users/zach/dev/test/next-module-not-found-bug/.next/build-manifest.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.loadComponents (/Users/zach/dev/test/next-module-not-found-bug/node_modules/next/dist/next-server/server/load-components.js:29:9)
at DevServer.findPageComponents (/Users/zach/dev/test/next-module-not-found-bug/node_modules/next/dist/next-server/server/next-server.js:529:60)
at DevServer.renderErrorToHTML (/Users/zach/dev/test/next-module-not-found-bug/node_modules/next/dist/next-server/server/next-server.js:829:33)
at DevServer.renderErrorToHTML (/Users/zach/dev/test/next-module-not-found-bug/node_modules/next/dist/server/next-dev-server.js:15:811)
at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
To Reproduce
I’ve created a reproduction repository here.
Note: The SASS error in this repository is intentional to demonstrate this Next.js issue
- Run the following in a terminal:
git clone https://github.com/zposten/next-module-not-found-bug.git
cd next-module-not-found-bug
yarn
yarn start
- See error
Expected behavior
The SASS error should be printed a single time. This other error should not be printed to the terminal continuously.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: macOS 10.15.3
- Version of Next.js: 9.3.2
Additional Context
Both of the apps that I’ve seen this issue in have
- Used typescript
- Had a custom
_app.tsx
- Used the new built in SASS support for global stylesheets
I have not exhaustively tested various configurations to figure out the precise cause of this issue.
This issue seems similar to:
…but all these issues are closed
Issue Analytics
- State:
- Created 3 years ago
- Reactions:29
- Comments:29
Top Results From Across the Web
'Error: Cannot find module '<path>/build-manifest.json'' masks ...
I'm aware that the dependency is not in package. json, which is intentional to show the error.
Read more >Nextjs: Cannot find module path build-manifest.json masks an ...
I have experienced this issue with Next.js many times. Error: Cannot find module 'dist/build-manifest.json' ... ... If you met this issue, just ...
Read more >Error: Cannot find module <path> build-manifest.json masks ...
I have experienced this issue with Next.js many times. If you met this issue, just simply check if you have a wrong or...
Read more >0 - Stack Overflow
NextJS - Error: Cannot find module '/<path>/.next/fallback-build-manifest.json' in next.config.js file · Ask Question. Asked 7 months ago.
Read more >module-not-found - Next.js
Why This Error Occurred · The module you're trying to import is not installed in your dependencies · The module you're trying to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I resolved this error by removing the
.next
folder andnode_modules
and reinstalling with yarn.I upgraded from 10.2.1 to 11.0.1 and went into this problem. Still found no fix 😦