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

"response.url" is empty in "response:*" life-cycle events in the browser #2030

Closed
4 tasks done
kettanaito opened this issue Feb 9, 2024 · 4 comments · Fixed by #2031
Closed
4 tasks done

"response.url" is empty in "response:*" life-cycle events in the browser #2030

kettanaito opened this issue Feb 9, 2024 · 4 comments · Fixed by #2031
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

@kettanaito
Copy link
Member

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

#2014 (comment)

Reproduction steps

worker.events.on('response:mocked', ({ response }) => {
  console.log(response.url)
})

Current behavior

response.url is empty ('')

Expected behavior

response.url must equal to the resolved response URL.

@kettanaito kettanaito added bug Something isn't working scope:browser Related to MSW running in a browser needs:triage Issues that have not been investigated yet. labels Feb 9, 2024
@kettanaito kettanaito self-assigned this Feb 9, 2024
@kettanaito
Copy link
Member Author

Released: v2.2.0 🎉

This has been released in v2.2.0!

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.

@radiantone
Copy link

radiantone commented Mar 2, 2024

Maybe this problem is related, but msw won't initialize
image

@radiantone
Copy link

      Object.defineProperty(response, 'url', {
        value: request.url,
        enumerable: true,
        writable: false,
      })
    }```
 request is always null

@marekopatril
Copy link

marekopatril commented Mar 5, 2024

@radiantone Im having same issue, its opened here #2053

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.

3 participants