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' }
I've created a reproduction repository here.
Note: The SASS error in this repository is intentional to demonstrate this Next.js issue
git clone https://github.com/zposten/next-module-not-found-bug.git
cd next-module-not-found-bug
yarn
yarn start
The SASS error should be printed a single time. This other error should not be printed to the terminal continuously.
If applicable, add screenshots to help explain your problem.
Both of the apps that I've seen this issue in have
_app.tsxI 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
This is a weird bug. I'm on an older version of Next (6.1.1, I should try updating!) but the error is weird. As mentioned in #4660, creating a blank build-manifest.json with the content {} fixes the issue (at least temporarily) and causes other more sensible errors to appear.
Had the same issue. Got it fixed by upgrading yarn
yarn upgrade
As soon as that was done, the build-manifest.json appeared.
Cheers!
Same issue here, i'm using NPM.
Just encountered this bug as well. Tried solutions from the other thread, to no success.
run into same bug
i also faced the same error whene I add new component to the pages!
what is your approach ?
i have this issue, when installing new project with typescript and adding aliases to folders in .babelrc and tsconfig
I tried install sass on my own with yarn add -D sass, the issue is resolved.
I tried install
sasson my own withyarn add -D sass, the issue is resolved.
Not working for me (using npm).
I tried install
sasson my own withyarn add -D sass, the issue is resolved.
I have tried it and it doesn't work