This repository demonstrates a compatibility issue between Jest v30 and synckit@0.11.10.
synckit@0.11.10 (released July 18, 2025) introduced a breaking change that causes Jest v30 tests to fail with a createRequire TypeError.
TypeError: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 'http://localhost/index.cjs'
at Function.createRequire (node_modules/jest-runtime/build/index.js:1407:23)
at Object.<anonymous> (node_modules/@pkgr/core/lib/index.cjs:10:48)
at Object.<anonymous> (node_modules/synckit/lib/index.cjs:30:29)
- June 1, 2025:
@pkgr/core@0.3.0introduced breaking changes with Jest'screateRequireimplementation - July 18, 2025:
synckit@0.11.10updated its dependency range to allow@pkgr/core@0.3.x - Dependency chain: Jest → jest-snapshot → synckit → @pkgr/core
- Comment out or remove the pnpm override from
package.json - Delete
pnpm-lock.yaml - Run
pnpm install - Run
nx test testorjest- tests will fail
- Keep the pnpm override in
package.json:"synckit": "0.11.9" - Run
pnpm install - Run
nx test testorjest- tests pass
The package.json includes a pnpm override to pin synckit to the last working version:
{
"pnpm": {
"overrides": {
"synckit": "0.11.9"
}
}
}- synckit: 0.11.10 (broken), 0.11.9 (works)
- Jest: 30.0.2
- NX: 21.3.0
- Node.js: Latest
- Package manager: pnpm (affects all package managers)
You can also pin the deeper dependency:
{
"pnpm": {
"overrides": {
"@pkgr/core": "0.2.9"
}
}
}