-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws-lambda-nodejs: Precompilation excludes path aliases in tsc command #20666
Comments
Well, I found out that you can't specify paths on the command line. So perhaps a better solution would be to use the custom tsconfig as a |
Further research shows that you cannot specify both a |
Sorry to chaingun the replies here, but the more research I do, the more workarounds I find. I found a related workaround on StackOverflow. Perhaps the solution is to create a temporary tsconfig that extends the project tsconfig and only includes the target file? |
Thanks for submitting this other bug report! We accept contributions, check out our contributing guide if you're interested - there's a low chance the team will be able to address this soon but we'd be happy to review a PR 🙂 |
I do have a question about the esbuild implementation. Why does it use the command line opposed to using the esbuild typescript API? |
For anyone who finds this issue via Google, you can get tsconfig.paths working in CDK (as well as Since CDK does not support esbuild plugins yet - using the cdk-esbuild construct
|
Related: #20650 |
Hi there, we are facing the same issue in my team. We are using Typescript and NodeJS function in an NX monorepository structure and have splitted our code in several libraries defining path in the Adding recently TypeDORM which works with annotation got our build and deploy of NodeJS Lambda failing (due to the lack of support of |
Describe the bug
Given the following compiler options:
The resultant compiler options given to the tsc runner excludes the paths object. This results in compiler errors. I've tracked this down to getTsconfigCompilerOptions(). The code handles only objects that are arrays.
Expected Behavior
Compiler options string should be (newlines added for readability)
Current Behavior
Compiler options are (newlines added for readability)
Which results in
Error: Failed to bundle asset...
Reproduction Steps
tsconfig.json
utils/calculator.ts
index.ts
Possible Solution
In getTsconfigCompilerOptions(), add an else condition to emit the json object as part of the command.
Additional Information/Context
No response
CDK CLI Version
2.27.0 (build 8e89048)
Framework Version
No response
Node.js Version
v18.2.0
OS
Ubuntu 22.04 LTS
Language
Typescript
Language Version
Typescript (4.7.2)
Other information
No response
The text was updated successfully, but these errors were encountered: