-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Memory leak when using apollo-client in an iframe. #7654
Comments
The bug seems to be solved in React 17, and is indeed cause by some loose I still think it's relevant and fixable since some projects still run on React 16 (React Native Web, for example) Otherwise, I'm pushing React 17 to my projects and hope it's the last I see of it. :) |
Let us know if this is still a concern with |
Most certainly still happening. @hwillson |
Thanks @KutnerUri - any chance you could share a runnable reproduction that shows this, to make it easier for maintainers to take a look? Also, would you mind trying with |
yes - copy this to a CRA's app.js, and click on Make sure to use React16. |
I can confirm it still happens in |
Hello,
It seems that closing an iframe, while Apollo is loading a request inside, together with user interaction, is causing the iframe to crush.
Sounds niche, but my app is heavily reliant on iframes to operate and separate user code from our main site.
Some hints I found trying to debug it:
fetch
anduseState()
instead of@apollo/client
Intended outcome:
Apollo client should gracefully shut itself down and free resources when closing. (maybe using the window onunload event)
Actual outcome:
Chrome freezes. :(
No errors are emitted to the log.
How to reproduce the issue:
I managed to reproduce the bug using the code in this gist:
https://gist.github.com/KutnerUri/5b65a2893c30a40646fe99726847a072
Paste it in a
create-react-app
to reproduce it yourself. (I used React 16)Does not happen using fetch and react state:
I could not make a live website using CodeSandbox, as it didn't allow iframes.
Versions
The text was updated successfully, but these errors were encountered: