Chunk load error when deployed ("Something's wrong here") #603
Replies: 1 comment 4 replies
-
I can say from first-hand experience that this is behavior is not specific to Hydrogen 😅. We see this all the time with a Gatsby app deployed on Netlify. Netlify supports "atomic" deploys. In other words, when you deploy a new version of your site, all the static files from the prior deploy are no longer accessible. This proves problematic when you're deploying a client-heavy frontend because your The good news is that Remix is well-positioned to handle this from a framework perspective. I'm not sure if this is supported at the moment but the Remix client runtime could be configured to disable form submits via XHR and fall back to a full page form submit. When the full page submit resolves, the user will receive a new I've gotten pretty deep into this issue, it's common across frameworks deployed on Netlify. |
Beta Was this translation helpful? Give feedback.
-
Currently we have a Hydrogen instance on production running via Netlify. On top of that, we are also fetching content from Storyblok. You can see the result on www.horando.de – the website itself runs smoothly and the metrics are very good. We love Hydrogen!
But we investigated an error, which comes up everytime we trigger a new deployment on Netlify. We are using webhooks on Storyblok and when content is published or unpublished, we always trigger a new build on Netlify. Sometimes, when there are a lot of changes, we have a higher amount of triggers in the queue. See the following screenshot:
If a deployment is ready, and you are opening up the website the first time, we see the following error:
In the console you can see a list of errors, the most interesting one is in the lowest position. If we click on it we see the following results:
I tried to find similar problems by googling it, but the only ones I found were two comments on Stackoverflow regarding the file hash key, which gets applied to the filenames and because of caching reasons the browsers expects an old hash key on the filename, which is not present anymore, because meanwhile the server already has newer files with newer hash keys (https://stackoverflow.com/questions/69300341/typeerror-failed-to-fetch-dynamically-imported-module-on-vue-vite-vanilla-set/74057337#74057337). But it is only my assumption here.
So like I said, this only happens when we trigger a new build. If you see the error page und just refresh the page, the error is gone, which leads me to think about that it might be a caching problem and the cache gets also refreshed while refreshing the website.
Any ideas to bugfix that? I already tried to set up a config where vite/rollup does not make us of hash keys, but then the website fully breaks.
I tried this in my vite config file:
Any help or ideas are appreciated.
Beta Was this translation helpful? Give feedback.
All reactions