Skip to content

Client side errors after deployment of new version #6492

Closed Answered by sergiodxa
Marcdj-02 asked this question in Q&A
Discussion options

You must be logged in to vote

Is there any way to (automatically) force the user's browser to update the javascript files and prevent such errors?

Remix doesn't provide a way to do this, but you can do it yourself.

First, the problem happens not because JS is cached, but because you have users that are not closing the app, if the user A opens your app today and never close the tab in a week, it will keep using the old version of JS, which can expect a different loader data shape.

Aside of the recommendation to try to avoid changing the shape of the loader's data in a way that's incompatible with old version (aka always add keys, never remove them), you will need to detect the current version of the JS client-side an…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@Marcdj-02
Comment options

Comment options

You must be logged in to vote
5 replies
@bondepike
Comment options

@iwan-uschka
Comment options

@markgreenwood
Comment options

@Annukul
Comment options

@patrick-mcdougle
Comment options

Answer selected by sergiodxa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants