-
Hey ✌️ I recently received an error on Sentry. Basically what happened is that express caches javascript files and I changed the response from a loader. Older route file loaded which expected a different response and it crashed. Has this happened to anyone else? Is there a way to fix it? I throught that it's Remix's responsibility to somehow generate different filename or something. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Filename have a unique hash there to prevent this issue, are you caching the HTML response? If you did that and since JS files are also cached for one year it will cause your app to use an old HTML that loads old JS files. |
Beta Was this translation helpful? Give feedback.
It can happen if the user has an old version of the app open, it's not that the user is receiving and old JS file, but that the user already has that JS file, there's nothing to do that, it's the same thing as if you have an old mobile app on your phone and the API had a breaking change.
The only way to prevent it to crash is by avoiding breaking changes. You could also detect when there's a new version and ask the user to reload the page to get a new version.