-
-
Notifications
You must be signed in to change notification settings - Fork 515
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: crypto.randomUUID is not a function
with msw 2.2.12
#2111
Comments
TypeError: crypto.randomUUID is not a function
error with msw 2.2.12TypeError: crypto.randomUUID is not a function
with msw 2.2.12
Hi, @maxime-bc. Thanks for reporting this! Looks like an oversight on my part. We cannot rely on |
Opened the fix in the underlying Interceptors package: mswjs/interceptors#536. Will update the dependency in MSW once it's released. |
Released: v2.2.13 🎉This has been released in v2.2.13! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Prerequisites
Environment check
msw
versionBrowsers
Chromium (Chrome, Brave, etc.), Firefox, Safari
Reproduction repository
https://github.com/maxime-bc/test-msw
Reproduction steps
npm install && npx vite --host 0.0.0.0
Then, try to access the website using both local and network addresses. In the tab accessed by the network address, the error will appear in the console.
Then, downgrade
msw
to 2.2.11 and start the dev server again:npm install [email protected] && npx vite --host 0.0.0.0
Again, access the website using both local and network addresses. This time the error will not appear.
Current behavior
Hello,
I'm encountering the following behavior: when accessing a website via its local address,
msw
works. But when using a network address, the following error is raised in the browser console :TypeError: crypto.randomUUID is not a function
.As far as I understand, this is the intended behavior as
crypto.randomUUID
is only available in secure contexts, such as localhost.What I found strange is that prior updating to
msw
2.2.12, I was on version 2.1.4 and I never had any issues withcrypto.randomUUID
, which was introduced in 2.0.0.I tried version 2.2.11 and had no issues, the error is not raised at all so it seems to be a problem with version 2.2.12 ?
Expected behavior
This error should not be raised ?
The text was updated successfully, but these errors were encountered: