AWS CDK bundling lambda docker used instead of esbuild / debian WSL2

Viewed 782

I have issues with cdk while trying to bundle lambdas with esbuild while working in my WSL2 debian
esbuild is installed as a global npm package and also in devDependencies of my cdk project

node --version
v14.16.0
cdk --version
1.95.1
esbuild --version
0.11.2

Examples of lambda definition

lex_create_bot = _lambda_node.NodejsFunction(
            self,
            id="lambda-lex-create-bot",
            entry="lambdas_fns/lex_create_bot/lex-create-bot.ts",
            handler="handler",
            runtime=_lambda.Runtime.NODEJS_14_X,
            bundling={"minify": True}
        )

Everytime I try to deploy, check diff, cdk try to bundle the lambdas with docker instead of esbuild.
I work on this stack for a while and eveything was fine until I switched from remote-container to WSL2 to manage my dev environement in vscode.

docker is really slow for bundling and creates diff for already deployed lambdas that have no code changes.
Any idea how to solve this ?

EDIT
Same issue with Ubuntu-20.04 WSL2

1 Answers

I upgrade to cdk 1.97.0 and esbuild 0.11.5 this morning and all is working well now.
Still a strange behavior that I want to avoid in the future, if anyone got a more generic solution to this problem ...

Related