msw
msw copied to clipboard
'Cannot read properties of undefined (reading 'url')' when multiple browser tabs are open
Prerequisites
- [X] I confirm my issue is not in the opened issues
- [X] I confirm the Frequently Asked Questions didn't contain the answer to my issue
Environment check
- [X] I'm using the latest
msw
version - [X] I'm using Node.js version 18 or higher
Browsers
Chromium (Chrome, Brave, etc.)
Reproduction repository
https://github.com/hal-shin/msw-bug
Reproduction steps
- install nodejs v20.12.2
- npm i
- npm start
- open 2 tabs 'http://localhost:3000/'
- after opening the second tab, you'll see the following error:
Current behavior
when the second tab opened, I see 'Cannot read properties of undefined (reading 'url')' error.
Affected versions: >2.1.7 Versions that work correctly: <= 2.1.7
Expected behavior
application should continue working when it is opened in 2 tabs.
Same behavior here with version 2.3.0
I got the same behavior here with version 2.3.0
I got the same result
@kettanaito Hi! I find this PR #2031. I think it is a reason of this bug. Can you fix it?
Also, I still get error with version 2.3.1
:(
Any update regarding this issue?
This is also happening on the latest version 2.4.11
, when multiple tabs of the same origin are open, this error shows up once for each open tab.
The service worker also crashes when you reload the page multiple times:
We are having this problem in our project. It breaks our screenshot/acceptance tests :(