Version
30.4.2
Steps to reproduce
-
Install Cypress (v15.x) alongside expect@30.4.x:
yarn add -D cypress expect@^30.4.1
-
Import expect in a Cypress support file (browser-bundled context):
// cypress/support/commands.js
import expect from 'expect'
-
Run any Cypress test:
yarn cypress run
Every test file fails to compile immediately.
Expected behavior
Cypress compiles and runs tests successfully, as it did with expect@30.3.0.
The expect package is published standalone specifically for use outside the Jest
runner (e.g. in Cypress, Playwright, or other browser-bundled test setups). It
should remain usable in those contexts.
Actual behavior
Webpack throws UnhandledSchemeError for every Node.js built-in imported with
the node: prefix in jest-util (a transitive dependency of expect):
Error: Webpack Compilation Error
Module build failed: UnhandledSchemeError: Reading from "node:path" is not handled by plugins
Module build failed: UnhandledSchemeError: Reading from "node:process" is not handled by plugins
Module build failed: UnhandledSchemeError: Reading from "node:url" is not handled by plugins
Module build failed: UnhandledSchemeError: Reading from "node:util/types" is not handled by plugins
The node: URI scheme is not handled by webpack by default. It requires an
additional plugin (e.g. NormalModuleReplacementPlugin) to resolve — but that
should not be the consumer's burden for a package that worked without it in 30.3.0.
Additional context
The regression was introduced by PR #16077 ("Node Protocol Standardization"),
which applied the unicorn/prefer-node-protocol ESLint rule across ~146 files as
a cosmetic style change. jest-util/build/index.js now contains:
const process = require('node:process');
const data = require("node:util/types");
const data = require("node:path");
const data = require("node:url");
None of these lines existed in 30.3.0. The node: prefix is a Node.js-only
convention with no functional difference at runtime in Node.js, but it is
unrecognised by webpack when bundling for browser targets.
Workaround: pin expect, jest, and babel-jest to ~30.3.0.
Environment
System:
OS: Ubuntu 24.04
Node: 24.x
Yarn: 1.x
Packages:
expect: 30.4.1
jest-util: 30.4.1 (regression introduced in 30.4.0)
cypress: 15.14.2
webpack (Cypress internal bundler): 5.x
Version
30.4.2
Steps to reproduce
Install Cypress (v15.x) alongside expect@30.4.x:
yarn add -D cypress expect@^30.4.1
Import expect in a Cypress support file (browser-bundled context):
// cypress/support/commands.js
import expect from 'expect'
Run any Cypress test:
yarn cypress run
Every test file fails to compile immediately.
Expected behavior
Cypress compiles and runs tests successfully, as it did with expect@30.3.0.
The expect package is published standalone specifically for use outside the Jest
runner (e.g. in Cypress, Playwright, or other browser-bundled test setups). It
should remain usable in those contexts.
Actual behavior
Webpack throws UnhandledSchemeError for every Node.js built-in imported with
the node: prefix in jest-util (a transitive dependency of expect):
Error: Webpack Compilation Error
Module build failed: UnhandledSchemeError: Reading from "node:path" is not handled by plugins
Module build failed: UnhandledSchemeError: Reading from "node:process" is not handled by plugins
Module build failed: UnhandledSchemeError: Reading from "node:url" is not handled by plugins
Module build failed: UnhandledSchemeError: Reading from "node:util/types" is not handled by plugins
The node: URI scheme is not handled by webpack by default. It requires an
additional plugin (e.g. NormalModuleReplacementPlugin) to resolve — but that
should not be the consumer's burden for a package that worked without it in 30.3.0.
Additional context
The regression was introduced by PR #16077 ("Node Protocol Standardization"),
which applied the unicorn/prefer-node-protocol ESLint rule across ~146 files as
a cosmetic style change. jest-util/build/index.js now contains:
const process = require('node:process');
const data = require("node:util/types");
const data = require("node:path");
const data = require("node:url");
None of these lines existed in 30.3.0. The node: prefix is a Node.js-only
convention with no functional difference at runtime in Node.js, but it is
unrecognised by webpack when bundling for browser targets.
Workaround: pin expect, jest, and babel-jest to ~30.3.0.
Environment
System: OS: Ubuntu 24.04 Node: 24.x Yarn: 1.x Packages: expect: 30.4.1 jest-util: 30.4.1 (regression introduced in 30.4.0) cypress: 15.14.2 webpack (Cypress internal bundler): 5.x