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

Cannot read properties of undefined (reading 'url') #2193

Closed
4 tasks done
nemonemi opened this issue Jul 2, 2024 · 3 comments
Closed
4 tasks done

Cannot read properties of undefined (reading 'url') #2193

nemonemi opened this issue Jul 2, 2024 · 3 comments
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser

Comments

@nemonemi
Copy link

nemonemi commented Jul 2, 2024

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 18 or higher

Browsers

Chromium (Chrome, Brave, etc.)

Reproduction repository

N/A

Reproduction steps

msw version: 2.3.0-ws.rc-7 - using it for the subscription mocking

I believe it's the same behavior and reason as described in this issue #2083.
image

Current behavior

Almost every time I reload my screen, or it is auto-reloaded it throws this error.

Cannot read properties of undefined (reading 'url')

Expected behavior

Does not throw this error.

@nemonemi nemonemi added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser labels Jul 2, 2024
@mbwestphal
Copy link

This is a nasty bug. We use an error handler of last resort. When there is an unhandled exception it will tear down the application, try to send diagnostics and present a generic error message to the user.

All we can do here is check if the error message is equal to Cannot read properties of undefined (reading 'url') and pray this rather generic error was really emitted by msw.

@nemonemi
Copy link
Author

nemonemi commented Aug 7, 2024

In my case, it happens only in the development mode. When it happens I simply close the React error popup and continue working. It is not super intrusive, but it would be great if it didn't occur.

@kettanaito
Copy link
Member

Looks like a duplicate of #2146. Let's track it there.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser
Projects
None yet
Development

No branches or pull requests

3 participants