ChunkLoadError: Loading chunk node_modules_next_dist_client_dev_noop_js failed

Javascriptnode.jsReactjsnext.js

Javascript Problem Overview


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:
Screenshot of error (1)

Error 2:
Screenshot of 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!

Javascript Solutions


Solution 1 - Javascript

Delete the .next folder at the root of your project, relaunch your project, and force-refresh your page (Shift+F5 / Cmd+Shift+R) to remove the cache.

It apparently is a cache issue. 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.

Solution 2 - Javascript

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.

Solution 3 - Javascript

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

Solution 4 - Javascript

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

Solution 5 - Javascript

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.

Solution 6 - Javascript

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAbdullah RajaView Question on Stackoverflow
Solution 1 - JavascriptdebView Answer on Stackoverflow
Solution 2 - JavascriptEILYAView Answer on Stackoverflow
Solution 3 - JavascriptSyed Zain JeelaniView Answer on Stackoverflow
Solution 4 - JavascriptJaxoo JackView Answer on Stackoverflow
Solution 5 - JavascriptFranco SalcedoView Answer on Stackoverflow
Solution 6 - JavascriptNatashia brysonView Answer on Stackoverflow