-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
emit an event when there are errors loading/preloading chunks #12080
Comments
I think it would be better to move this upstream, so you don't need to rely on |
I'll submit a PR. I would suggest solely emitting the event and leaving it up to frameworks/users to handle the reload (or not) as they would like. |
Thanks for the heads up @doutatsu 👍🏼 |
will it also solve "regular" failed dynamic imports? Because in my case, probably 99% are related to this and not chunks that no longer exists after a deploy :/ |
I imagine it would then be possible to trigger a retry. Though it would be
useful to have a suggestion as to how.
…On Tue, 6 Jun 2023, 21:11 Victor Neves, ***@***.***> wrote:
will it also solve "regular" failed dynamic imports? Because in my case,
probably 99% are related to this and not chunks that no longer exists after
a deploy :/
—
Reply to this email directly, view it on GitHub
<#12080 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAN26FVPUC7JBALARRGCVLXJ6FFVANCNFSM6AAAAAAU6JV4YY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
The PR adds an error event - it's up to you to handle it. You can see how we handle the chunk loading errors in Nuxt on route change. Note that regular failed imports (ie. not chunk loading errors) will not trigger this error. |
Well for me the strange is that Vue has functionality that when working with dynamic imports allows you to set a number of retries automatically but nevertheless even doing the retries it always fails when executing the import. e.g:
|
Description
I would love to be able to catch errors when preloading chunks (which often occurs when a new deployment has taken place) so that I can handle thiings appropriately.
Suggested solution
This is how we've implemented within Nuxt:
https://github.com/nuxt/nuxt/pull/19038/files#diff-7860a08e52b47fe432d19a402b062801774cefbb935172e30ce1e83a1ec6a962
Alternative
No response
Additional context
I would be very happy to implement this within Vite. It's a relatively small (and non-breaking) change
Validations
The text was updated successfully, but these errors were encountered: