Skip to content

Jest v30 compatibility issue with synckit@0.11.10 due to @pkgr/core dependency update #252

@FrozenPandaz

Description

@FrozenPandaz

Bug Report

Summary

synckit@0.11.10 (released July 18, 2025) introduced a breaking change that causes Jest v30 tests to fail with a createRequire TypeError. This is due to updating the @pkgr/core dependency to a version incompatible with Jest's module loading.

Error Message

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)
    at _jestSnapshot (node_modules/@jest/expect/build/index.js:29:16)
    at createJestExpected (node_modules/@jest/expect/build/index.js:44:28)
    at node_modules/@jest/expect/build/index.js:52:41
    at node_modules/@jest/expect/build/index.js:53:3
    at Object.<anonymous> (node_modules/@jest/expect/build/index.js:56:12)

Environment

  • synckit version: 0.11.10 (broken), 0.11.9 (works)
  • Jest version: 30.0.2+
  • @pkgr/core version: 0.3.4 (broken), 0.2.9 (works)
  • Node.js version: Latest
  • Package manager: Any (affects pnpm, npm, yarn)

Root Cause Analysis

  1. June 1, 2025: @pkgr/core@0.3.0 introduced breaking changes with Jest's createRequire implementation
  2. July 18, 2025: synckit@0.11.10 updated its dependency range to allow @pkgr/core@0.3.x, pulling in the incompatible version
  3. Dependency chain: Jest v30 → @jest/expect → jest-snapshot → synckit → @pkgr/core

Reproduction Repository

I've created a complete reproduction case: https://github.com/FrozenPandaz/jest-synckit-issue

Steps to Reproduce

  1. Clone the reproduction repository
  2. Remove the pnpm override from package.json
  3. Delete pnpm-lock.yaml and run pnpm install
  4. Run either:
    • nx test test (NX command)
    • cd apps/test && TS_NODE_COMPILER_OPTIONS='{"moduleResolution":"node10","module":"commonjs","customConditions":null}' npx jest (Jest directly)

Both will fail with the createRequire error above.

Expected Behavior

Tests should run successfully as they did with synckit@0.11.9

Actual Behavior

Jest tests fail to start due to module loading errors in the synckit → @pkgr/core dependency chain

Current Workaround

Pin synckit to the last working version using package manager overrides:

For pnpm:

{
  "pnpm": {
    "overrides": {
      "synckit": "0.11.8"
    }
  }
}

For npm:

{
  "overrides": {
    "synckit": "0.11.8"
  }
}

For yarn:

{
  "resolutions": {
    "synckit": "0.11.8"
  }
}

Suggested Fix

Update synckit's dependency on @pkgr/core to exclude the problematic 0.3.x versions until they resolve Jest compatibility. For example:

  • Pin to @pkgr/core: "^0.2.0"
  • Or exclude broken versions: @pkgr/core: "^0.3.0 \!=0.3.0 \!=0.3.1 \!=0.3.2 \!=0.3.3 \!=0.3.4"

Impact

  • Affects all Jest v30 users who depend on packages using synckit
  • Common in NX projects, ESLint configurations, and other tooling
  • Breaking change appeared suddenly on July 18, 2025 with synckit@0.11.10 release

Additional Context

  • This only surfaced yesterday due to synckit@0.11.10 updating its dependency range
  • @pkgr/core versions 0.3.0+ are incompatible with Jest v30's createRequire implementation
  • The issue occurs in Jest's core initialization, not user configuration
  • No Jest configuration workaround exists that avoids this dependency chain

Related Issues

Thank you for maintaining synckit! This library is widely used and this compatibility fix would help many Jest v30 users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions