superset icon indicating copy to clipboard operation
superset copied to clipboard

fix: added events listeners to fix chunk error #28259

Open Sabutobi opened this issue 1 year ago • 2 comments

SUMMARY

Modify the superset-frontend/src/setup/setupApp.ts to catch chunk errors

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: image

After: image

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 avatar May 20 '24 15:05 Sabutobi

@Sabutobi We cannot assume that ChunkLoadErrors are always the result of outdated frontend assets.

michael-s-molina avatar May 21 '24 12:05 michael-s-molina

@Sabutobi We cannot assume that ChunkLoadErrors are always the result of outdated frontend assets.

Yep. The problem is the desynchronization between backend and front-end assets.

Sabutobi avatar May 21 '24 12:05 Sabutobi

Hey @mistercrunch @rusackas @michael-s-molina . Maybe some news about this PR? Can I proceed with merging/should I close it?

Sabutobi avatar Jul 02 '24 10:07 Sabutobi

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.

rusackas avatar Jul 03 '24 17:07 rusackas

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

philicious avatar Jul 29 '24 13:07 philicious

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.

mistercrunch avatar Jul 29 '24 18:07 mistercrunch

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.

Sabutobi avatar Aug 03 '24 13:08 Sabutobi

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 avatar Apr 14 '25 21:04 rusackas

@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.

Sabutobi avatar Apr 15 '25 14:04 Sabutobi