12

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.

4 Answers 4

19

I had this same issue, removing the "#" from the project path worked just fine.

Sign up to request clarification or add additional context in comments.

1 Comment

That fixed it for me, thanks!
10

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.

2 Comments

Helps me. Special characters on directory path causing this problem. Thank you!
I had a hyphen in my directory path, removing it worked for me!
2

In file next.config.js insert in module.exports:

webpack5: false

2 Comments

You are a Life-saver !
Tried this but got "Webpack 4 is no longer supported in Next.js. Please upgrade to webpack 5 by removing "webpack5: false" from next.config.js." ... I am running Next version 12.1.5
0

I had a hyphen in my root directory for my Next.js project, changing my root folder from my-app to just myapp fixed the issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.