Sabutobi commented on code in PR #28604: URL: https://github.com/apache/superset/pull/28604#discussion_r1609860026
########## superset-frontend/src/setup/setupApp.ts: ########## @@ -87,6 +87,27 @@ export default function setupApp() { window.location.reload(); }); }); + // Chuck errors fix: https://github.com/apache/superset/issues/28259 + window.addEventListener('error', e => { + // prompt user to confirm refresh + if (/Loading chunk [\d]+ failed/.test(e.message)) { + alert( + 'A new version released. Need to reload the page to apply changes.', + ); + window.location.reload(); + } + }); + const origin = console.error; + console.error = error => { Review Comment: > Creating some sort of React ErrorBoundary that does something similar? Used the existing one. > Also, would be great if we can use and antd modal instead of the native alert() Used the `antd` lib there. Could you please double-check if possible? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org