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]: Undefined moduleResolution #4499

Closed
Kirdock opened this issue Aug 7, 2024 · 1 comment · Fixed by #4500
Closed

[Bug]: Undefined moduleResolution #4499

Kirdock opened this issue Aug 7, 2024 · 1 comment · Fixed by #4500
Labels
🐛 Bug Confirmed Bug is confirmed

Comments

@Kirdock
Copy link

Kirdock commented Aug 7, 2024

Version

29.2.4

Steps to reproduce

70b9530#diff-f224a564a1241776e5fb6e152ab37fdea5b11413e12bc26aed643552fcab269dR150
This change introduced the usage of Node10, which is not a valid typescript enum value (or at least starting with 4.9.5; I don't know when this was changed).

So this._ts.ModuleResolutionKind.Node10 is not working and should be this._ts.ModuleResolutionKind.NodeJs instead. This is undefined in our typescript version (4.9.5) and only contains

export enum ModuleResolutionKind {
        Classic = 1,
        NodeJs = 2,
        Node16 = 3,
        NodeNext = 99
    }

Expected behavior

I can use ts-jest without the error error TS6046: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.

Actual behavior

It's not possible to use ts-jest because it uses an undefined value for the moduleResolution. So overriding bad 😅

Debug log

Test suite failed to run

error TS6046: Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.

Additional context

No response

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13950HX
  Binaries:
    Node: 20.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.6.0 - C:\Program Files\nodejs\pnpm.CMD
  npmPackages:
    jest: ^29.7.0 => 29.7.0
@Kirdock Kirdock changed the title [Bug]: Incorrect moduleResolution [Bug]: Undefined moduleResolution Aug 7, 2024
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 7, 2024

ah crab, should be an easy fix 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Confirmed Bug is confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants