Skip to content
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

Gracefully handle missing code bundles (no internet or app updated) #312

Closed
incognitojam opened this issue Nov 5, 2022 · 2 comments
Closed
Labels

Comments

@incognitojam
Copy link
Collaborator

incognitojam commented Nov 5, 2022

We get errors like this when a client loads the site and later, after an update has been deployed to the server, tries to access a different page which requires loading a code bundle. The client requests the JS bundle from the server, but the new deployment doesn't serve this file anymore (each bundle has a hash in the file name), so the client errors.

ChunkLoadError: Loading chunk 3 failed.
(missing: https://connect.comma.ai/static/js/3.ff182016.chunk.js)
  at None (https://connect.comma.ai/:1:4730)
  at _callee16$ (qr-scanner.ts:633:16)
  at tryCatch (None:7:30)
  at key (None:7:30)
  at Promise ([native code])

This error can also happen if the user goes offline after they load the page originally.

We should do at least one of the following things:

  • Serve old bundles for longer (maybe at least a week after each release)
  • Request a reload when an update is detected
    • Some apps show a prompt to the user and we can reload the page when they confirm
  • Catch the error
    • Perhaps show a fallback notice that the app is out of date
    • Reload the page

Related: https://stackoverflow.com/a/62038528/1908134

@incognitojam incognitojam changed the title Gracefully handle updates and bundles being deleted before lazy load Gracefully handle missing code bundles (no internet or app updated) Nov 5, 2022
@sentry-io
Copy link

sentry-io bot commented Nov 5, 2022

Sentry issue: CONNECT-1BH

@incognitojam
Copy link
Collaborator Author

This is partially fixed by #392, but the update available/ready state should be surfaced somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant