Prerequisites
Environment check
Browsers
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 msw@2.2.11 && 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 with crypto.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 ?
Prerequisites
Environment check
mswversionBrowsers
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.0Then, 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
mswto 2.2.11 and start the dev server again:npm install msw@2.2.11 && npx vite --host 0.0.0.0Again, 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,
mswworks. 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.randomUUIDis only available in secure contexts, such as localhost.What I found strange is that prior updating to
msw2.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 ?