This is the error is occurring when I try to run a npm run dev
.
I don't understand what's happening and I tried these: deleting package-lock.json
, deleting node_modules
, reinstalling npm, but nothing works.
PS D:\Users\user\Documents\Projects\NLW#5\podcastrnext> npm run dev
> [email protected] dev D:\Users\user\Documents\Projects\NLW#5\podcastrnext
> next dev
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 - ../../NLW#5/podcastrnext/node_modules/next/dist/client/dev/amp-dev.js
Error: Cannot find module 'D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\@next\react-refresh-utils\loader.js'
Require stack:
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\compiled\webpack\bundle5.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\compiled\webpack\webpack.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\next-server\server\config-utils-worker.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\next-server\server\config-utils.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\next-server\server\config.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\server\next.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\server\lib\start-server.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\cli\next-dev.js
- D:\Users\user\Documents\Projects\NLW#5\podcastrnext\node_modules\next\dist\bin\next
<i> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Node.js doesn't offer a (nice) way to introspect the ESM dependency graph yet.
<i> Until a full solution is available webpack uses an experimental ESM tracking based on parsing.
<i> As best effort webpack parses the ESM files to guess dependencies. But this can lead to expensive and incorrect tracking.
<i> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Node.js doesn't offer a (nice) way to introspect the ESM dependency graph yet.
<i> Until a full solution is available webpack uses an experimental ESM tracking based on parsing.
<i> As best effort webpack parses the ESM files to guess dependencies. But this can lead to expensive and incorrect tracking.
Can not find module next? A module not found error can occur for many different reasons: The module you're trying to import is not installed in your dependencies. The module you're trying to import is in a different directory. The module you're trying to import has a different casing.
The Error: Cannot find module 'node:events' occurs if you are not using the latest version of node. js 16.6. 0 or above and developing the discord bots. We can fix the issue by upgrading the Node.
The 'module not found' error is a syntax error that appears when the static import statement cannot find the file at the declared path. This common syntax error is caused by letter-casing inconsistencies that are present in your filename(s) between your repository and local machine, or both.
Or You can use Next. js CLI In your project root directory enter command npx next --version .
I had this same issue, removing the "#" from the project path worked just fine.
I was able to resolve my problem, I don't know exactly what it was, but I might have a clue.
I was trying to run in this folder "D:\Users\user\Documents\Projects\NLW#5\podcastrnext" and didn't work. Than I tried changing to another folder, this is the folder that I used "D:\Users\user\Documents\Projects\podcastr" and this time worked.
I believe the problem was in the special character "#", somehow the program got lost with it.
In file next.config.js insert in module.exports:
webpack5: false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With