projen icon indicating copy to clipboard operation
projen copied to clipboard

TS Error on latest builds

Open jessebye opened this issue 2 years ago • 2 comments

On our latest scheduled upgrade builds, we are seeing this TS error:

Run npx projen build
👾 build » default | node .projenrc.js
👾 build » post-compile » synth:silent | cdk synth -q

/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:42530
        ts.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
                 ^
Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
    at Object.resolveTypeReferenceDirective (/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:42530:18)
    at /home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/ts-node/src/index.ts:623:55
    at Array.map (<anonymous>)
    at Object.resolveTypeReferenceDirectives (/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/ts-node/src/index.ts:622:33)
    at actualResolveTypeReferenceDirectiveNamesWorker (/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:116611:163)
    at resolveTypeReferenceDirectiveNamesWorker (/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:116911:26)
    at processTypeReferenceDirectives (/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:118393:31)
    at findSourceFileWorker (/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:118278:21)
    at findSourceFile (/home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:118133:26)
    at /home/runner/work/cdk-ml-pilot/cdk-ml-pilot/node_modules/typescript/lib/typescript.js:118085:85

Subprocess exited with error 1
👾 Task "build » post-compile » synth:silent" failed when executing "cdk synth -q" (cwd: /home/runner/work/cdk-ml-pilot/cdk-ml-pilot)

Could be caused by these PRs? https://github.com/projen/projen/pull/1881 or https://github.com/projen/projen/pull/1882

jessebye avatar May 26 '22 15:05 jessebye

Those two PRs would have fixed new projects created with projen, but not existing ones.

To fix an existing project you could run: npm install --save-dev ts-node@^10 or yarn add --dev ts-node@^10

and then run projen again

msessa avatar May 26 '22 15:05 msessa

you can fix this by adding to .projenrc.js

project.addDevDeps('ts-node@^10');

tinytelly avatar Jul 03 '22 11:07 tinytelly

Issue is resolved.

mrgrain avatar Aug 26 '22 19:08 mrgrain