Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thomasballinger opened this issue Nov 26, 2024 · 1 comment

Comments

@thomasballinger
Copy link

Version

29.2.5

Steps to reproduce

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

git clone [email protected]: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
@thomasballinger
Copy link
Author

I originally thought this was CI thing (because the cache is never populated there!)

@thomasballinger thomasballinger changed the title [Bug]: Module resolution for custom condition fails if cache available [Bug]: Module resolution for custom condition fails if no cache available Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant