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

Requests aren't intercepted anymore since 2.4.4 #2385

Open
4 tasks done
dbanck opened this issue Dec 6, 2024 · 1 comment
Open
4 tasks done

Requests aren't intercepted anymore since 2.4.4 #2385

dbanck opened this issue Dec 6, 2024 · 1 comment
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node

Comments

@dbanck
Copy link

dbanck commented Dec 6, 2024

Prerequisites

Environment check

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

Node.js version

v20.18.0

Background

Thanks for this great library. We've been using it for some time now to mock response in the vscode-terraform test suite.

During some regular dependency bumps we noticed that the mocking didn't work anymore.

Reproduction repository

https://github.com/dbanck/playground-vscode-msw-bug

Reproduction steps

  • Open the reproduction repository with VSCode
  • Run the extension (F5)
  • Run the "hello world" command
    CleanShot 2024-12-06 at 15 24 58@2x

Current behavior

The request isn't intercepted anymore

The request isn't captured by any of the life-cycle events that log to the extension debug channel
CleanShot 2024-12-06 at 15 25 28@2x

Axios logs a 404 error, because the request isn't mocked and a real request is sent to https://example.com/test
CleanShot 2024-12-06 at 15 26 06@2x

Expected behavior

I have traced it back to this change: v2.4.3...v2.4.4

When I downgrade msw to 2.4.3 everything is working as expected.

The request is logged by the lifecycle events
CleanShot 2024-12-06 at 15 30 21@2x

And my mocked response is returned
CleanShot 2024-12-06 at 15 30 36@2x

@dbanck dbanck added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node labels Dec 6, 2024
@jmccure
Copy link

jmccure commented Dec 9, 2024

Noticed the same updating to 2.4.4 here https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/2188/diffs

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:node Related to MSW running in Node
Projects
None yet
Development

No branches or pull requests

2 participants