Mock Service Worker Releases Version 3.0
The release drops Node.js v18 and v20 support, switches to ES Modules only, and adds GraphQL subscription support.
Updated on Nov. 26, 2026 in Software

Mock Service Worker released version 3.0, distributed natively as ECMAScript Modules only and dropping support for Node.js v18 and v20. The release supports Node.js v22, v24, and v26 and requires TypeScript 5.9 or later.
Why it matters
The release brings GraphQL subscription support, a long-standing community request, and reworks network interception in Node.js. Developers on earlier versions are advised to consult the official 2.x to 3.x migration guide before upgrading.
The library tarball falls from 416KB to 234KB and type definitions fall from 190KB to 90KB compared with the previous release. The removal of the path-to-regexp, picocolors, and statuses dependencies accounts for part of the reduction, though the stub does not break down the contribution of each change.
The players
Mock Service Worker
Mock Service Worker is an open-source API mocking library for JavaScript that intercepts network requests in browsers and Node.js.
Nock
Nock is an open-source HTTP mocking library for Node.js that relies on the Interceptors library for its Node.js support.
The details
Version 3.0 introduces granular entrypoints that replace the single msw import with designated paths for each protocol. GraphQL subscription handlers are defined against graphql.link() and publish events on demand, and an experimental defineNetwork API is included. The Interceptors library moves network interception in Node.js to the TCP and TLS wraps, which supports arbitrary socket-based protocols; Nock relies on the same library for its Node.js support.
Timeline
Mock Service Worker v2.0 was released with its Fetch-based rewrite nearly three years before v3.0.
Mock Service Worker v3.0 was released on 2026-11-26.
The Tech Race
The move to ECMAScript Modules only follows the broader migration of the Node.js ecosystem away from CommonJS. Dropping Node.js v18 and v20 places the library on the current supported runtimes of v22, v24, and v26.
Developers using Node.js v18 or v20 must upgrade their runtime before adopting v3.0, and projects must use TypeScript 5.9 or later. Teams on v2 should follow the official migration guide to handle the switch to ES Modules and the optional graphql peer dependency.
The takeaway
Upgrading to Mock Service Worker v3.0 requires a supported Node.js runtime and TypeScript 5.9 or later, so teams should check their toolchain before migrating. Reviewing the migration guide first reduces the risk of breaking changes in existing test suites.
Further reading
Explore more Software coverage to see how open-source library releases like this one affect developer workflows.
Source note: This article includes information reported by InfoQ.



