You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works but the eslint config in create-react-app creates a compile error whenever you access a global variable which is not whitelisted in the eslint "browser" environment and AbortController is so new that it is not included there yet.
You can workaround the issue by adding "const AbortController = window.AbortController;" in each file where you use AbortController. This will not be necessary once the npm "globals" package lists AbortController in the browser environment (which will probably happen reasonably soon, one way or the other).
Activity
mo commentedon Jan 25, 2018
It works but the eslint config in create-react-app creates a compile error whenever you access a global variable which is not whitelisted in the eslint "browser" environment and AbortController is so new that it is not included there yet.
You can workaround the issue by adding "const AbortController = window.AbortController;" in each file where you use AbortController. This will not be necessary once the npm "globals" package lists AbortController in the browser environment (which will probably happen reasonably soon, one way or the other).
I've created a boilerplate repo that shows "create-react-app + unfetch + abortcontroller-polyfill", see:
https://github.com/mo/abortcontroller-polyfill-create-react-app-example
asimmakhmudov commentedon Dec 14, 2021
Thanks!