bug(aws-lambda-nodejs): esbuild preCompilation not finding local tsc #19242
Labels
@aws-cdk/aws-lambda-nodejs
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p1
What is the problem?
The esbuild
preCompilation
option requires typescript to be installed globally and does not find a local (project) installation.Reproduction Steps
With no global typescript installation, but local typescript dev dependency and the following configuration:
What did you expect to happen?
tsc
command should be found when typescript is locally installed.What actually happened?
CDK CLI Version
2.15.0
Framework Version
2.15.0
Node.js Version
14.15.3
OS
Windows 10
Language
Typescript
Language Version
TypeScript (4.3.5)
Other information
Searching for command
tsc
is happening here:aws-cdk/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts
Line 92 in de31f9f
aws-cdk/packages/@aws-cdk/aws-lambda-nodejs/lib/package-installation.ts
Lines 10 to 17 in de31f9f
It tries to find the local installation using
require('tsc/package.json')
which can not be found. The package name has to betypescript
instead oftsc
to detect it correctly.aws-cdk/packages/@aws-cdk/aws-lambda-nodejs/lib/util.ts
Lines 91 to 98 in de31f9f
The text was updated successfully, but these errors were encountered: