fix: added events listeners to fix chunk error #28259
SUMMARY
Modify the superset-frontend/src/setup/setupApp.ts to catch chunk errors
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TESTING INSTRUCTIONS
N/A. Raised only while cloud providers deployment.
ADDITIONAL INFORMATION
- [x] Has associated issue: #28259
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
@Sabutobi We cannot assume that ChunkLoadErrors are always the result of outdated frontend assets.
@Sabutobi We cannot assume that
ChunkLoadErrorsare always the result of outdated frontend assets.
Yep. The problem is the desynchronization between backend and front-end assets.
Hey @mistercrunch @rusackas @michael-s-molina . Maybe some news about this PR? Can I proceed with merging/should I close it?
Honestly not sure... I think the modal is great, but I'm not sure about adding the event listener to the window object or how serious the risk of false positives might be. I haven't found the time to look into alternative solutions, but maybe some more exploration of the topic is needed. I'll have a chat with our AI overlords when I find time.
I'm actually curious what @dosu-bot has to say about this, or whether it knows of alternate approaches to monitoring for webpack bundle updates and reloading the React app.
I fixed the dreaded Chunk-Load-Error in React+Webpack Apps that use Code-Splitting by using a "lazy-retry" as outlined in this great article https://www.bitahoy.com/blog/post/fixing-chunk-load-errors-in-webpack-and-react-js
Works like a charm in our React App
Tagging @kgabryje for visibility since he's been working on chunking recently (more on the perf angle), but he's also very knowledgeable about the Superset frontend.
I fixed the dreaded Chunk-Load-Error in React+Webpack Apps that use Code-Splitting by using a "lazy-retry" as outlined in this great article https://www.bitahoy.com/blog/post/fixing-chunk-load-errors-in-webpack-and-react-js
Works like a charm in our React App
Hey @philicious . Thanks for advice. I'll try it.
Is there any interest in carrying this forward? I'll convert it to draft for now since it's still in need of a rebase, but it may eventually be closed if it remains inactive.
@rusackas I've resolved the problem on my project. So that's not really important for my proj right now. I can close this one if needed.