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') #2083

Closed
4 tasks done
kmiwa-clari opened this issue Mar 12, 2024 · 6 comments · Fixed by #2094
Closed
4 tasks done

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

kmiwa-clari opened this issue Mar 12, 2024 · 6 comments · Fixed by #2094
Assignees
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

@kmiwa-clari
Copy link

kmiwa-clari commented Mar 12, 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.2.1

For some reason, the request object here is occasionally undefined. When it is, this line throws

Cannot read properties of undefined (reading 'url')

Seem to be introduced during 0e9d65f

I don't know if this is intentional or not, or what the fix is, just reporting this runtime error. Thanks for all you do!

Current behavior

Throws

Cannot read properties of undefined (reading 'url')

Expected behavior

Does not throw this error

@kmiwa-clari kmiwa-clari 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 Mar 12, 2024
@benjaminpearson
Copy link

I've been experiencing this as well for a couple of weeks on a project, came here to see if anyone else had opened a bug. It looks like its also been raised here #2053 and the last comment there is that its being looked into and downgrading to 2.1.4 in the meantime is one workaround (in case that helps).

@kmiwa-clari
Copy link
Author

Yup that's what I ended up doing although I think 2.1.7 should work as it's just before the 2.2.0 release which added this runtime error.

@kettanaito
Copy link
Member

Opened a fix in #2094.

@kettanaito
Copy link
Member

Also marking this as a duplicate of #2053.

@kettanaito
Copy link
Member

Released: v2.2.6 🎉

This has been released in v2.2.6!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

@mbwestphal
Copy link

This is still happening in 2.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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

Successfully merging a pull request may close this issue.

4 participants