msw icon indicating copy to clipboard operation
msw copied to clipboard

'Cannot read properties of undefined (reading 'url')' when multiple browser tabs are open

Open vik-buchinski opened this issue 9 months ago • 6 comments

Prerequisites

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

  1. install nodejs v20.12.2
  2. npm i
  3. npm start
  4. open 2 tabs 'http://localhost:3000/'
  5. after opening the second tab, you'll see the following error: image

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.

vik-buchinski avatar May 10 '24 07:05 vik-buchinski

Same behavior here with version 2.3.0

akumapps avatar May 27 '24 15:05 akumapps

I got the same behavior here with version 2.3.0

kaique64 avatar May 31 '24 02:05 kaique64

I got the same result

gypz24 avatar Jun 17 '24 08:06 gypz24

@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 :(

ByteWither avatar Jun 25 '24 09:06 ByteWither

Any update regarding this issue?

PedroBarbosaSw avatar Sep 11 '24 14:09 PedroBarbosaSw

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: image

Crauzer avatar Oct 14 '24 09:10 Crauzer

We are having this problem in our project. It breaks our screenshot/acceptance tests :(

Marcosld avatar Oct 21 '24 08:10 Marcosld