-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChunkLoadError (timeout: (chunks/xxx) #38507
Comments
I have the same problem, also happening in Chrome and Safari. If the user does a super reload (hold down Shift while reloading) it resolves the problem, but there is no way to make the user do a super reload from javascript. |
This error occurs in the production environment and is reported regularly on Sentry. |
Does anyone have a solution for this? We are running into this regularly |
This issue still occurs in production environment and happens quite a lot using latest NextJS. |
My application keeps having this problem (with dynamic imports) |
This error is thoroughly explained here. It's an error due to caching split chunks of the js bundle. The bigger issue is that it cannot be recovered from in production. A possible way to fix it is to edit the cache parameters on the index or page file where is the address to the chunk is provided. I don't know how to do that. |
You are assuming that this is the issue, but I'm not convinced. For us all of the chunks that are presumably not loading still exist to this day. Even while the loading error was from a month ago, the chunk still exists now. |
I'm having the same issue with the same situation described by @ianwensink , all the chunks still exist and can be accessed. |
commenting here to ask if there is any way to solve the issue? I built my webapp using nextjs13 and it's been super frustrating when I tried to release it to production |
Also experiencing this very exact problem. commenting here and hoping for some sort of viable solution from either the nextjs or vercel team. Someone mentioned a service worker solution to load all js and chunks. has anyone tried this and does it work? |
I got this problem too in production with Vercel... |
Hello ! I have the same issue after resetting my cache of my website in production in google chrome: I have found : https://rollbar.com/blog/javascript-chunk-load-error/ Along with this approach, it’s also a good idea to have your index.html and entrypoint files never cached, which can be done using the cache-control header (Cache-Control - HTTP | MDN) |
I have the same issue in production, any solution? |
I have found a solution, don't know if it can help you :
When you do a fetch with no-cache, it will fetch a new page and you will no longer have this error again for the specific page. It works for me... |
Same |
I dont think this is the problem, at least in my case, because the problematic chuck is accessible after the error has ocurred. For example I get a stacktrace like this in sentry:
If I try to access |
Has anyone made any progress on this issue? I'm running into the same problem and cannot for the life of me figure out how to resolve this. |
I have the same issue and here is the interesting things:
|
I have the same issue, being experienced by users in production (they end up seeing a network error toast). It is happening only on Chrome (113 & 114), but on Windows and macOS. The JS bundle files are accessible. |
I have the same issue. Happening on iPhone OS. No problem on desktop browsers. |
I'm encountering the same issue while deploying my app to AWS Amplify Hosting. |
My problem was with a tailwind class. I was assigning a class after rendering the component. I deleted it and now it works :) |
Link to this tweet here: |
The same with me. Did you solve this issue? |
Happens to me as well. Sentry shows that it only affects safari users, mainly iPhone OS, but there are also a few MacOS incidents |
This issue is raised for a lot of Android users on inapp browsers like Facebook or Instagram... I don't know what to do. |
I think this might actually be a Next issue in this case. You can have chunk loading errors with any app that uses code splitting, but this one in particular is interesting to me bc of the way it behaves. When working w/ SPA apps on Webpack in the past, we solved this problem by updating the cache w/ the new chunks. The links were actually bad when clicking them (the chunk actually did not exist anymore). This one "feels" to me like Next bc the chunk actually loads whenever I follow the link. Our logs are blowing up w/ chunk loading errors on the user front, however, when I visit the link to the chunk that failed to load, it always loads for me. I think this is odd bc the chunk does in fact exist and the URL points to the chunk. It seems like there is either a timing problem where it doesn't exist for a short period of time, or it is having problems being loaded properly. Might not be a Next error, but it feels like it would be as the chunk does exist and I can always link to it correctly. |
Sentry is still reporting this type of errors in our prod, any progress on this ? |
We're (Sentry) looking at filtering these errors out by default since they don't seem to be actionable. Would this be helpful to y'all? |
How about handling it in error boundary to force reload the window after clearing all the caches when there's |
It's not necessarily to do with deploying. I have a NextJS application that was deployed on (and running since) April 28th and I still get Chunk Load Errors almost daily. |
I had this issue with the latest Canary version. I updated to this package version Likely unrelated, but on initial deploy, my main page 404s and I occasionally have to |
Heads up - the change to default ignore these error is live on sentry.io |
upgrading to next v13.5.4 seems to fix the issue for me |
we now seem to be running into this issue as well, did try upgrading to next v13.5.4 and hasn't fixed it |
This comment has been minimized.
This comment has been minimized.
I got this error as well in production. In my case this error happened when I add Next.js |
I also have the error in v14.0.0 |
I have the same problem with v14.0.0 If i refresh the page works |
I pretty sure the this error on 13/14 with App dir was caused by this PR - #54752 |
After removing all instances of 'import Script from 'next/script'', it worked perfectly again for me. |
Check #57829 out. Remove |
thank you, it work for me |
I have the same problem, after deploying a demo branch for a customer. |
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! |
I was having this problem with next 14.0.2. Downgrading to 14.0.0 worked for me |
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 When get resource in _next then get error :( |
@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 |
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. |
Verify canary release
Provide environment information
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
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 traficThe text was updated successfully, but these errors were encountered: