-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
TypeError: Expected signal to be an instanceof AbortSignal #470
Comments
Update:
|
@frankandrobot I am not sure we are ready to close this one. Maybe we should add the polyfill to Happy DOM? 🙂 |
yea you're right @capricorn86 . Technically I just found a workaround but it would be nice if fetch "just works" . There are three things that we need to do:
Note: in our code base, we actually ended up using the classes JSDOM provides :-) (The reason is because we originally thought we needed way more polyfills. ) Most likely the public polyfill packages should work 🤞 Also, I can actually totally help out on this one. :-) |
@frankandrobot What did you do to make this work for you? I'm getting the exact same error. I'm running on happy-dom@6 so it might've been working <6? |
In the above comments, there's a link to a test repo with absolute URLs.
If you want relative relative URLs, that's a different story. I tried repoing the fix in a test repo with just node-fetch and no dice.
In our repo, we use whatgfetch and then we import all of the above mentioned polyfills from jsdom! I'll see if i can get that working in the test repo 🙂
On Jun 30, 2022 6:23 PM, hornta ***@***.***> wrote:
@frankandrobot<https://github.com/frankandrobot> What did you do to make this work for you? I'm getting the exact same error. I'm running on ***@***.*** so it might've been working <6?
—
Reply to this email directly, view it on GitHub<#470 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAGAGMI25E2JKAAEKGVGCGTVRYT7FANCNFSM5VSCJX3Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
It still fails for me even though we don't use relative urls and I think I set it up exactly as you've. I hope this will get fixed in this package since there are no other good working solution. The error I'm getting now is: An unhandled error occured processing a request for the endpoint "getDataLayerStatus".
In the case of an unhandled error, no tags will be "provided" or "invalidated". TypeError: Request is not a constructor How it's mocked: import _fetch from "node-fetch";
import {
AbortController,
abortableFetch,
} from "abortcontroller-polyfill/dist/cjs-ponyfill";
const { fetch, Request } = abortableFetch(_fetch);
global.fetch = fetch;
global.Request = Request;
// @ts-ignore
global.AbortController = AbortController; |
This has finally been fixed. You can read about the release here: |
Summary: happy-dom/jest-environment does not work with MSW and rtk-query
Environment:
Sample repo: https://gitlab.com/robotandkid/the-sandbox/-/tree/mre/jest-happy-dom/happy-dom-test
Steps to repo:
Analysis:
The text was updated successfully, but these errors were encountered: