Skip to content
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

globalThis.WebSocket is undefined and it can't be proxied. #668

Closed
Afsoon opened this issue Oct 31, 2024 · 2 comments · Fixed by #669
Closed

globalThis.WebSocket is undefined and it can't be proxied. #668

Afsoon opened this issue Oct 31, 2024 · 2 comments · Fixed by #669

Comments

@Afsoon
Copy link
Contributor

Afsoon commented Oct 31, 2024

Hello

Our current dependanbot PR is failing with the latest MSW version, after debugging and tracking changes in the repository I have conclude the following:

Our setup is Vitest + Happy-DOM + Remix, I have tested prior version of MSW, and it didn't have this problem.

I'm not 100% sure of the fix, but I think it's a missing a check that is:

  if (typeof descriptor.get() === "undefined") {
    return false;
  }

If it's the fix, I can create a PR with the test.

@kettanaito
Copy link
Member

Hi, @Afsoon. Thanks for reporting this.

Let's discuss it first. Just checking the getter not being there isn't enough—the property descriptor can have a value and no get, and that's a valid property that must return true. Will look at your pull request in more detail once I have a moment (thanks for opening that btw!).

@kettanaito
Copy link
Member

Released: v0.36.8 🎉

This has been released in v0.36.8!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants