Open sckimynwa opened 1 year ago
Or, It would also be nice to support custom delay functions for user I think 🤔
// optional value to set the amount of time in milliseconds before trying to load the chunk again. Default is 0
// if string, value must be code to generate a delay value. Receives retryCount as argument
// e.g. `function(retryAttempt) { return retryAttempt * 1000 }`
It looks like you can give retryDelay a function. I just use a regular delay, but it is in the readme.
Edit: Looks like this was a version 1 feature not a version 2 feature. So could be a good addition to version 2/3
A way to log failed chunk load URLs would be good to debug failed chunk-loading retries.
I know you can load chunks different ways, but I often handle it where I load. I use specific chunks. I try to keep the chunks related to sections, especially rarely used ones that only get loaded if they are needed.
try {
mymodules = await import 'somemodule';
} catch(err) { logger.error(err); throw err;}
And I use catchall. https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event
Unhandled errors should be going to console anyway, but if you have like an external logger might be good idea to have that catchall anyway.
Summary
Hi, I'm recently using this plugin to my project. Thanks to this plugin, it reduces my chunk load failed error a lot. as a user of this plugin, I think it would be nice if you provide some various retry options like
exponential backoff
For Example,
Thank you in advance.
Reference