Got a strange error with event bridge and sst.Func...
# help
s
Got a strange error with event bridge and sst.Function this morning.
Copy code
Error: Cannot find asset at /home/simon/code/projects/event-bridge/.build/lib/runtime
    at new AssetStaging (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/core/lib/asset-staging.ts:170:13)
    at new Asset (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-s3-assets/lib/asset.ts:127:21)
    at AssetCode.bind (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-lambda/lib/code.ts:277:20)
    at new Function3 (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-lambda/lib/function.ts:583:29)
    at SingletonFunction.ensureLambda (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-lambda/lib/singleton-lambda.ts:134:12)
    at new SingletonFunction (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-lambda/lib/singleton-lambda.ts:56:32)
    at new AwsCustomResource (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts:360:22)
    at new LogGroupResourcePolicy (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-events-targets/lib/log-group-resource-policy.ts:34:5)
    at CloudWatchLogGroup2.bind (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-events-targets/lib/log-group.ts:38:7)
    at Rule2.addTarget (/home/simon/code/projects/event-bridge/node_modules/@aws-cdk/aws-events/lib/rule.ts:166:32)
When running
sst test
the lambda gets built correctly:
Copy code
$ tree -L 1 .build/
.build/
├── eslint.js
├── lib
├── run.js
├── src-lambda-main-1623997587633
├── sst-debug.log
└── sst-merged.json
When running deploy the lambda does not build
sst deploy
Copy code
$ tree -L 1 .build/
.build/
├── cdk.out
├── eslint.js
├── lib
├── run.js
├── sst-debug.log
├── sst-merged.json
└── sst-start-cache.json
Source code for the stack