unstale

npm / msw

msw

What changed in msw 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.

17 breaking14 new APIs and options3 behavior and defaults2 tooling34 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

msw 335 changes

Breaking changes 15

  • The Content-Length request header is removed by bypass().

    3.0.0release notes

  • MSW no longer manages cookies in Node.js; cookie behavior follows the environment default. Browser behavior is unchanged.

    3.0.0release notes

  • The defineNetwork() API is the replacement for the removed handleRequest() utility.

    3.0.0release notes

  • MSW is now ESM-only, affecting how projects load and bundle the package.

    3.0.0release notes

  • MSW no longer patches setTimeout; advance fake timers normally for delayed mocked responses to resolve.

    3.0.0release notes

  • file:// requests now throw in Node.js, matching fetch behavior because fetch does not support them.

    3.0.0release notes

  • GraphQLLinkHandlers is renamed to GraphQLLink.

    3.0.0release notes

  • The handleRequest() utility is removed; use defineNetwork() instead.

    3.0.0release notes

  • Upgrade requests made via fetch() now throw in Node.js, matching fetch behavior because fetch does not support them.

    3.0.0release notes

  • The msw/native entrypoint is removed in favor of @msw/react-native.

    3.0.0release notes

  • The minimal supported Node.js version is v22; Node.js v18 and v20 support is deprecated.

    3.0.0release notes

  • The onUnhandledRequest option is renamed to onUnhandledFrame.

    3.0.0release notes

  • This now returns null in handlers in all environments; use the cookies resolver argument for cookie-based logic.

    3.0.0release notes

  • TypeScript 5.9 is the minimum supported version; support for 5.1 and 5.2 is deprecated, and versions 6.0 and 7.0 are supported.

    3.0.0release notes

  • The WebSocket connection life cycle event is renamed from connection to websocket:connection.

    3.0.0release notes

New APIs and options 7

  • GraphQL is exported from msw/graphql and handled as an optional peer dependency.

    3.0.0release notes

  • MSW now supports GraphQL subscriptions.

    3.0.0release notes

  • MSW now supports GraphQL v17.0.

    3.0.0release notes

  • Import individual utilities such as delay or passthrough from msw/utils for a smaller bundle footprint.

    3.0.0release notes

  • MSW can now intercept page navigations and form submissions.

    3.0.0release notes

  • A new WebSocket life cycle event lets consumers listen to connection errors.

    3.0.0release notes

  • A new WebSocket Extension API enables better custom experiences.

    3.0.0release notes

Behavior and default changes 2

  • Intercepted request headers can now be modified in passthrough scenarios.

    3.0.0release notes

  • worker.stop() now returns a Promise; awaiting it matters only in in-flight critical scenarios.

    3.0.0release notes

Tooling 2

Fixes and other changes 9

  • Network sources expose network context on enable.

    3.0.3release notes

  • Reset handlers are disposed of when reset, preventing them from remaining active.

    3.0.3release notes

  • Supports virtual:msw imports in Vitest.

    3.0.2release notes

  • Treats CONNECT requests as the transport mechanism.

    3.0.1release notes

  • Fixed localStorage cookie persistence causing maximum quota exceeded errors.

    3.0.0release notes

  • Fixed in-flight requests being incorrectly passed through when performed before calling worker.stop().

    3.0.0release notes

  • Various issues related to network interception in Node.js are fixed.

    3.0.0release notes

  • MSW now supports Node.js v24 and v26.

    3.0.0release notes

  • Preventing page closure via a beforeunload listener no longer unregisters the MSW worker.

    3.0.0release notes

msw 235 changes

Breaking changes 2

  • In Node.js, toPublicUrl now removes search parameters.

    2.12.3release notes

  • The browser and react-native export conditions are ordered lower, changing package export resolution.

    2.12.2release notes

New APIs and options 7

  • Adds the finalize API for handler cleanup.

    2.14.4release notes

  • Support handling connection upgrades with ws.onUpgrade.

    2.14.0release notes

  • Adds a public test() method to WebSocketHandler.

    2.13.6release notes

  • Use the network source architecture through defineNetwork.

    2.13.0release notes

  • Exports the AnyHandler type for developers to use.

    2.12.10release notes

  • Exports the GraphQLLinkHandlers type for use by developers.

    2.12.7release notes

  • Adds support for server-sent events (SSE).

    2.12.0release notes

Behavior and default changes 1

  • The SSE response stream now invokes finalize when it ends.

    2.15.0release notes

Fixes and other changes 25

  • Logging for concurrent requests is now handled properly.

    2.14.7release notes

  • Prevents event forwarding manually.

    2.14.6release notes

  • All frame listeners are removed when the client closes.

    2.14.5release notes

  • Prevents a frame abort listener leak.

    2.14.3release notes

  • Exports the NetworkApi type so developers can use it.

    2.14.2release notes

  • Fixes exporting default handler controllers.

    2.14.1release notes

  • Cookies are forwarded only when the response is used.

    2.14.0release notes

  • User-provided responses are no longer cloned.

    2.14.0release notes

  • Generator state is reset when .resetHandlers() or .restoreHandlers() is called.

    2.13.5release notes

  • The underlying SSE stream now respects request.signal, allowing request cancellation to affect the stream.

    2.13.4release notes

  • Prevent infinite mode from throwing.

    2.13.2release notes

  • Life-cycle events are now annotated correctly.

    2.13.1release notes

  • WebSocket connections are no longer logged in the console when there are no matching event handlers.

    2.13.0release notes

  • URL matching now supports wildcard ports.

    2.12.14release notes

  • GraphQL supports responses with the application/graphql-response+json content type.

    2.12.13release notes

  • The postinstall script now handles special characters, preventing installation issues in environments where they occur.

    2.12.12release notes

  • In Node.js, infinite delays no longer leave open handles.

    2.12.11release notes

  • ws.link supports relative URLs.

    2.12.9release notes

  • Updated the interceptors dependency to fix a memory leak.

    2.12.8release notes

  • Supports TypedDocumentString as a request predicate.

    2.12.7release notes

  • The SSE worker now respects the quiet option.

    2.12.6release notes

  • Server-Sent Events now handle multi-line messages.

    2.12.5release notes

  • Handles incomplete localStorage in Node.js v25.

    2.12.4release notes

  • Types used in HttpHandler are now published for developers to use.

    2.12.3release notes

  • Fixes response init in response:* events.

    2.12.1release notes