Skip to content

[Bug]: Module resolution for custom condition fails if no cache available #4639

@thomasballinger

Description

@thomasballinger

Version

29.2.5

Steps to reproduce

See repro at https://github.com/thomasballinger/ts-jest-repro

git clone git@github.com:thomasballinger/ts-jest-repro.git
cd ts-jest-repro/packages/tests
npm i
npx jest # should fail
npx jest # should succeed the second time
npx jest --no-cache # should fail again

Expected behavior

I expect --no-cache to behave the same as without the flag. I'd like this custom condition to resolve, so I'd like this test to pass.

Actual behavior

The custom condition appears not to be followed for package if --no-cache is used, or if it's the first run.

Debug log

ts-jest.log

Additional context

No response

Environment

System:
    OS: macOS 15.1.1
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
    pnpm: 9.10.0 - ~/.nvm/versions/node/v18.18.0/bin/pnpm
    bun: 1.1.36 - ~/.bun/bin/bun
  npmPackages:
    jest: ^29.7.0 => 29.7.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions