yet-another-abortcontroller-polyfill throwing TypeError: Illegal constructor #34296
Closed
2 tasks done
Labels
stale?
Issue that may be closed soon due to the original author not responding any more.
topic: core
Relates to Gatsby's core (e.g. page loading, reporter, state machine)
topic: frontend
Relates to frontend issues (e.g. reach/router, gatsby-link, page-loading, asset-loading, navigation)
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
Our error logs are filling up with "TypeError: Illegal constructor". The problem started when we upgraded from Gatsby v4.2.0 to v4.4.0.
We managed to trace the message's origin to this line of code:
https://github.com/benlesh/abort-controller-polyfill/blob/b40db6f1274a24bc7bc404339efe64a5012b3e78/index.js#L12
Which recently became part of Gatsby in #33530 here:
gatsby/packages/gatsby-legacy-polyfills/src/polyfills.js
Line 9 in c7efdb9
In addition to legacy browsers, we're seeing this error reported by Safari 13-14, Chrome 83-86, and Firefox 83, none of which I would expect to run the polyfill at all.
I downloaded Firefox 57 to reproduce the error. What I learned:
new AbortController()
is enough to cause the error to be thrown.I would suggest removing the polyfill and simply not aborting requests in older browsers.
Reproduction Link
https://www.gatsbyjs.com/ using Firefox 56
Steps to Reproduce
Open the site
Expected Result
Site loads normally
Actual Result
Site throws
TypeError: Illegal constructor
.AbortController
as well, they can crash. Apollo Client is an example.Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: