Skip to content
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

Suppress error logging when needed #10

Closed
vipinnair22 opened this issue Aug 10, 2020 · 1 comment
Closed

Suppress error logging when needed #10

vipinnair22 opened this issue Aug 10, 2020 · 1 comment

Comments

@vipinnair22
Copy link

Hello,

I'm using this plugin to refresh the page whenever chunk load fails. I have configured the last resort step to do something like this.

  new RetryChunkLoadPlugin({
        maxRetries: 3,
        lastResortScript: `window.chunkLoadFailed = true; 
                           window.location.reload(true)`
      })

The window.chunkLoadFailed piece of code is being used for logging my custom event and we don't want to log an actual error when this happens. I'm wondering if it's possible to suppress error logging if needed. Thanks!

@mattlewis92
Copy link
Owner

Hey there, you could override the onerror handler and use that to filter out the error message: https://stackoverflow.com/a/7133529 This is the only way I can think of to do it, as the script chunk loading error comes from the browser itself and not from anything this plugin does. Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants