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

fix: cannot compile source js after upgrade to typescript@5 #112

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

robertu7
Copy link
Contributor

@robertu7 robertu7 commented Feb 21, 2024

Latest commit bumped typescript to 5.x and it might break the extend of tsconfig.json.

Docker image failed to build with latest commit https://github.com/thematters/lambda-handlers/actions/runs/7546221162/job/20543566673:

#20 [builder 10/12] RUN node --loader ts-node/esm ./bin/gen-handlers-entry.ts
#20 0.354 (node:1) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
#20 0.354 (Use `node --trace-warnings ...` to show where the warning was created)
#20 0.661 /usr/app/node_modules/ts-node/src/index.ts:859
#20 0.661     return new TSError(diagnosticText, diagnosticCodes, diagnostics);
#20 0.661            ^
#20 0.663 TSError: ⨯ Unable to compile TypeScript:
#20 0.663 error TS6053: File '@tsconfig/node18/tsconfig.json' not found.
#20 0.663 
#20 0.663     at createTSError (/usr/app/node_modules/ts-node/src/index.ts:859:12)
#20 0.663     at reportTSError (/usr/app/node_modules/ts-node/src/index.ts:863:19)
#20 0.663     at createFromPreloadedConfig (/usr/app/node_modules/ts-node/src/index.ts:874:36)
#20 0.663     at create (/usr/app/node_modules/ts-node/src/index.ts:624:10)
#20 0.663     at register (/usr/app/node_modules/ts-node/src/index.ts:591:15)
#20 0.663     at Object.registerAndCreateEsmHooks (/usr/app/node_modules/ts-node/src/esm.ts:116:34)
#20 0.663     at file:///usr/app/node_modules/ts-node/esm.mjs:8:7
#20 0.663     at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
#20 0.663   diagnosticCodes: [ 6053 ]
#20 0.663 }
#20 ERROR: process "/bin/sh -c node --loader ts-node/esm ./bin/gen-handlers-entry.ts" did not complete successfully: exit code: 1

#15 [stage-2 6/7] COPY --from=runtime /usr/app/node_modules/ ./node_modules/
#15 CANCELED
------
 > [builder 10/12] RUN node --loader ts-node/esm ./bin/gen-handlers-entry.ts:
0.663     at createTSError (/usr/app/node_modules/ts-node/src/index.ts:859:12)
0.663     at reportTSError (/usr/app/node_modules/ts-node/src/index.ts:863:19)
0.663     at createFromPreloadedConfig (/usr/app/node_modules/ts-node/src/index.ts:874:36)
0.663     at create (/usr/app/node_modules/ts-node/src/index.ts:624:10)
0.663     at register (/usr/app/node_modules/ts-node/src/index.ts:591:15)
0.663     at Object.registerAndCreateEsmHooks (/usr/app/node_modules/ts-node/src/esm.ts:116:34)
0.663     at file:///usr/app/node_modules/ts-node/esm.mjs:8:7
0.663     at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
0.663   diagnosticCodes: [ 6053 ]
0.663 }
------
Dockerfile:13
--------------------
  11 |     COPY ./handlers ./handlers
  12 |     COPY ./tsconfig.json ./
  13 | >>> RUN node --loader ts-node/esm ./bin/gen-handlers-entry.ts
  14 |     COPY ./tsconfig.json ./*.ts ./
  15 |     RUN npm run build
--------------------
ERROR: failed to solve: process "/bin/sh -c node --loader ts-node/esm ./bin/gen-handlers-entry.ts" did not complete successfully: exit code: 1
Error: Process completed with exit code 1.

ref: TypeStrong/ts-node#2076 (comment)

@robertu7 robertu7 requested review from gary02 and tx0c February 21, 2024 09:56
@robertu7 robertu7 merged commit f398621 into main Mar 5, 2024
2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix/docker-build branch March 5, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants