You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While #9823 is solved (by #14995), in my workspace without swc and relying on ts-node instead, I'm getting a new error (see below Failure Logs)
Expected Behavior
The executor should successfully run, as it does when swc is installed:
» nx run demo:build
> nx run demo:build
Executor ran for Build {}
—————————————————————————————————————————————————————————————
> NX Successfully ran target build for project demo (378ms)
» nx run demo:build --verbose
> nx run demo:build
> NX ⨯ Unable to compile TypeScript:
error TS5024: Compiler option 'module' requires a value of type string.
error TS5024: Compiler option 'target' requires a value of type string.
TSError: ⨯ Unable to compile TypeScript:
error TS5024: Compiler option 'module' requires a value of type string.
error TS5024: Compiler option 'target' requires a value of type string.
at createTSError (/Users/emily.klassen/code/sandbox/repro-local-plugin-issue/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/Users/emily.klassen/code/sandbox/repro-local-plugin-issue/node_modules/ts-node/src/index.ts:863:19)
at createFromPreloadedConfig (/Users/emily.klassen/code/sandbox/repro-local-plugin-issue/node_modules/ts-node/src/index.ts:874:36)
at create (/Users/emily.klassen/code/sandbox/repro-local-plugin-issue/node_modules/ts-node/src/index.ts:624:10)
at register (/Users/emily.klassen/code/sandbox/repro-local-plugin-issue/node_modules/ts-node/src/index.ts:591:15)
at registerTranspiler (/Users/emily.klassen/code/sandbox/packages/nx/src/utils/register.ts:64:25)
at registerTranspiler (/Users/emily.klassen/code/sandbox/packages/nx/src/utils/register.ts:78:12)
at registerPluginTSTranspiler (/Users/emily.klassen/code/sandbox/packages/nx/src/utils/nx-plugin.ts:194:23)
at /Users/emily.klassen/code/sandbox/packages/nx/src/config/workspaces.ts:326:35
at /Users/emily.klassen/code/sandbox/packages/nx/src/command-line/run.ts:189:28
————————————————————————————————————————————————————————————————————————————
> NX Running target build for project demo failed
Failed tasks:
- demo:build
Hint: run the command with --verbose for more details.
Additional Information
No response
The text was updated successfully, but these errors were encountered:
forivall
changed the title
Local plugin "Unable to compile TypeScript" error without swc
Local plugin "Unable to compile TypeScript" error with ts-node (without swc)
Feb 16, 2023
nx-plugin.ts lines 196,197 are using enum values from TS but those are numbers not strings which are not valid values for the module and target options when registering a TS project.
Looks like when registering the compiler with ts-node the typing for compilerOptions is object which means that the number/string mismatch will not be caught. The typings as per the typescript package are ModuleKind and ScriptKind for module and target but when actually using that value in ts-node it does not seem to like the fact they are numbers vs strings?
Current Behavior
While #9823 is solved (by #14995), in my workspace without swc and relying on ts-node instead, I'm getting a new error (see below Failure Logs)
Expected Behavior
The executor should successfully run, as it does when swc is installed:
GitHub Repo
https://github.com/forivall/nx-repro-local-plugin-issue/tree/without-swc
Steps to Reproduce
npm install
npx nx run demo:build --verbose
Nx Report
Failure Logs
Additional Information
No response
The text was updated successfully, but these errors were encountered: