little-cartoon-10569
10/18/2022, 2:47 AM<ref *1> TypeError: pf.parseFunction is not a function or its return value is not iterable
at /pulumi/projects/pulumi-infrastructure/node_modules/@pulumi/runtime/closure/createClosure.ts:418:44
at Generator.next (<anonymous>)
at /pulumi/projects/pulumi-infrastructure/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:21:71
at new Promise (<anonymous>)
at Object.<anonymous>.__awaiter (/pulumi/projects/pulumi-infrastructure/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:17:12)
at serializeWorkerAsync (/pulumi/projects/pulumi-infrastructure/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:210:20)
at /pulumi/projects/pulumi-infrastructure/node_modules/@pulumi/runtime/closure/createClosure.ts:377:26
at Generator.next (<anonymous>)
at fulfilled (/pulumi/projects/pulumi-infrastructure/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:18:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
promise: Promise { <rejected> [Circular *1] }
new CallbackFunction
. Never saw it before, and I've created plenty of CallbackFunctions.callback: async () => {}
and I'm still getting that exception.green-bird-4706
10/18/2022, 2:51 AMlittle-cartoon-10569
10/18/2022, 8:13 PMexpect(true).toBe(true)
. But I'm getting that exception. So it looks like the mixin code itself is not 100% compatible with the unit test harness in TS/JS.setUpState()
function). That might be a lead....great-sunset-355
10/19/2022, 9:28 AMzod
So we abandoned CallbackFunction entirely and added yarn build
step before deployment and then attach the code as an archive
code: new pulumi.asset.AssetArchive
this way you can run the code as usual, all imports work and everythinglittle-cartoon-10569
10/19/2022, 7:32 PMgreat-sunset-355
10/20/2022, 9:55 AMyarn workspace
then yarn workspace @org/lambda build
then use standard function this.fn = new aws.lambda.Function(
with
code: new pulumi.asset.AssetArchive({
dist: new pulumi.asset.FileArchive(path.join(lambdaDir, args.serviceDef.dirName, "dist")),
node_modules: new pulumi.asset.FileArchive(path.join(lambdaDir, args.serviceDef.dirName, "node_modules")),
// If you have a shared library you need to manually pick up the shared lib package because AssetArchive does not follow
// the symlinks generated by the yarn workspace
"node_modules/@org/lambda-lib": new pulumi.asset.FileArchive(path.join(lambdaDir, "lib")),
})