简体   繁体   中英

ChunkLoadError: Loading chunk node_modules_next_dist_client_dev_noop_js failed

I've been following the basics tutorial on the Next.js website and when I got to the Global Styles step , I started getting the following runtime error:

ChunkLoadError: Loading chunk node_modules_next_dist_client_dev_noop_js failed.
(error: http://localhost:3000/_next/static/chunks/fallback/node_modules_next_dist_client_dev_noop_js.js)

Error 1:
错误截图(一)

Error 2:
错误截图(二)

I followed all the steps exactly and when I close the error pop-up, the app works fine.

If anyone can provide any guidance on this I'd appreciate it a lot!

Try deleting the .next folder at the root of your project.

I just had the same problem, and I have no idea why, but it was apparently caused by the cache. Maybe yours is, too.

After browsing through GH Issues & various blog posts, my conclusion is that nobody knows what the heck is going on with this webpack-related error, probably caused by Next.js's behavior.

I had this error after removing files from the /public folder.

How I fixed it:

  1. Remove your /.next folder.
  2. Launch your project again.
  3. Force refresh in you browser to delete the cache.

For me, the problem appeared when I added a plugin to tailwind.config.js (using tailwind)

maybe this will help someone locate strange nextjs behavior

In my case, I couldn't find the.next folder to be deleted.

Delete all the contents of the build / folder. This worked for me.

clean cache of your app.

  1. delete.next folder in the root dir
  2. re-run the app

I deleted the.next folder in VSC. The console log generated more errors, so I then restored the folder back to the project. The errors disappeared.

I solved using this:

  1. Deleting the.next folder
  2. Restart the server

In my case i had my next.js build directory with a different name as hosted with firebase cloud functions. Follow these similar steps

  1. Delete your build (distDir) directory (mine was called nextjs)
  2. Restart the server
  3. Force Refresh the browser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM