vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.37k stars 27.02k forks source link

ChunkLoadError (timeout: (chunks/xxx) #38507

Closed mdcarter closed 1 year ago

mdcarter commented 2 years ago

Verify canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64
Binaries:
  Node: 16.16.0
  npm: 8.11.0
  Yarn: 1.22.18
  pnpm: N/A
Relevant packages:
  next: 12.2.2
  eslint-config-next: 12.1.5
  react: 17.0.2
  react-dom: 17.0.2

What browser are you using? (if relevant)

Firefox 102.0

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

When a next js project containing static pages is hosted on Vercel (or anywhere I'm guessing) it regularly generate exception related to chunk loading

ChunkLoadError: Loading chunk 3662 failed.
(error: https://xxx.com/_next/static/chunks/29107295-0151559bd23117ba.js)

I looked everywhere for a simple fix for this, it exist in dev mode (simply delete the .next folder) but nothing for website in production since it's a caching issue.

Expected Behavior

This should not happen, or generate exceptions

Link to reproduction

https://stackblitz.com/edit/vercel-next-js-ehpskx

To Reproduce

Create a nextjs project with static pages (via getStaticProps), install Sentry for error tracking and generate trafic

jianliao commented 1 year ago

Check #57829 out. Remove beforeInteractive could work around this issue.

lunoob commented 1 year ago

Check #57829 out. Remove beforeInteractive could work around this issue.

thank you, it work for me

donttouchmylancable commented 1 year ago

I have the same problem, after deploying a demo branch for a customer. The Main Branch that worked for a month also doesnt work any more. I even deleted the cache of both project, but it results in the same issue

huozhi commented 1 year ago

Is anyone still having the chunk loading issue after upgrading to 14.0.2 where we had a fix for it or above versions? If you still have the problem with new version, please open a new issue with reproduction that would be helpful for investigating the specific issues you're encountering. Thanks!

igorvargasp commented 1 year ago

I was having this problem with next 14.0.2. Downgrading to 14.0.0 worked for me

iamtun commented 12 months ago

I was having this problem in two project with versions: 13.1.1 page router & 13.4.19 app router. I get error in prod domain/_next/static/media/physics.8bfdd492.svg 522 domain/_next/static/chunks/webpack-a0c7d2a893c108f8.js net::ERR_ABORTED 522

When get resource in _next then get error :( Can you help me fix it. Thanks

huozhi commented 12 months ago

@igorvargasp @iamtun could you file a different issue with reproduction? It's not clear what the exact issue is and what's the root causes of them

github-actions[bot] commented 11 months ago

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.