-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[docs-infra] Fix AbortController error #46408
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
base: master
Are you sure you want to change the base?
[docs-infra] Fix AbortController error #46408
Conversation
Netlify deploy previewhttps://deploy-preview-46408--material-ui.netlify.app/ Bundle size report
|
47e2c92
to
d730030
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think AbortController
is the right thing to use with useEffect
.
I was able to repro and fix by just adding a reason for aborting:
abortController.abort('useEffect cleanup');
@dav-is The problem is still here when I apply the diff proposed: ![]() I don't get the Next.js error overlay, but spam in the console is equally not acceptable. |
@oliviertassinari To fix the
I’m seeing an uncaught promise error that actually originates in the extension itself. It overrides window.fetch, apparently to inject polyfills, but the custom implementation doesn’t support AbortController. On any page using AbortController, it will throw. This seems like a bug in the extension, so it’d be great to file an issue with the author. Monkey-patching the global fetch in an extension is risky. If they need polyfills, it should be scoped or exposed via a dedicated helper rather than replacing In our code, we rely on AbortController to cancel an in-flight request when a new one starts or when unmounting. If this PR was merged as is, the original HTTP request never stops, leading to wasted bandwidth and potential memory leaks. |
This is a regression from #45596: checkout the PR, and go to ANY pages in dev mode, e.g. https://0.0.0.0:3000/, you will get (at least, I do):
The root of the problem seems to be with SimilarWeb https://chromewebstore.google.com/detail/similarweb-website-traffi/hoklmmgfnpapgjgcpechhaamimifchmp?hl=en&pli=1, when I disable the extension, it works as expected. Now, AbortControlled seems not needed in this context; a variable is as simple and provides the same behavior.
I noticed this while I was iterating on #46228.