Closed artem-kurnikov closed 3 years ago
hey @tigger9flow ! thanks for reporting that. In the browser, cross-fetch
is just a wrapper around whatwg-fetch. Can you check if that is happening there as well?
Here's some code to help:
<script>
// Delete native fetch api to force the polyfill installation
delete window.fetch
delete window.Request
delete window.Response
delete window.Headers
</script>
<script src="https://unpkg.com/whatwg-fetch@3.5.0/dist/fetch.umd.js"></script>
If it does, please report the issue on https://github.com/github/fetch/issues. Otherwise, please let me know so I can take a look.
Hey, @lquixada! You're totally right, it's reproduced in whatwg-fetch
as well. Sorry for bothering you, I just haven't managed to find the dependency of browser-specific implementation of fetch
. Duplicated the issue in whatwg-fetch
repo. Thank you! :)
no worries @tigger9flow ! happy to help! thanks for reporting the issue on whatwg-fetch
!
Seems like
cross-fetch
has a memory leak. Tested in the browser (Google Chrome, 88). The issue is reproduced by simple script (ignore CORS error, it behaves the same when request is resolved) which fires requests in interval:After profiling around 1 minute, we can see that event listeners are constantly growing:
While they are fine with native
fetch
: