Skip to content

Requests aren't intercepted anymore since 2.4.4 #2385

@dbanck

Description

@dbanck

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscope:nodeRelated to MSW running in NodewontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions