I have broken things in a new and exciting way. Co...
# typescript
f
I have broken things in a new and exciting way. Code:
Copy code
workspace.name.apply(name => `SecurityInsights(${name.toLowerCase()})`);
name
is an
Output<string>
, or it should be, but I'm getting a runtime panic because
undefined.toLowerCase
doesn't exist. I'm ssh'd into the ci/cd server manually editing the compiled js, and name does indeed look like an object /
Output<something>
, so I'm truly at a loss here
l
Try displaying just the
name
without calling toLowerCase on it. It looks to me like that Output is wrapping undefined
f
I agree
I'm in a typescript monorepo setup with
pnpm
, and I enabled the split-pnpm-lockfile option to give each package its own
pnpm-lock.yaml
file - this was going to help our build times whenever we added a new workspace - but I eventually figured out that this was the change that broke our pulumi previews/deploys. I "reverted" the change (added a new commit disabling the setting, and leaving a warning for my future self) and everything is right back up and running.
... I also downgraded from typescript5.5-beta to 5.4.x; which could have been the culprit? but I don't think so. That just happened to be along for the ride
Someday when I get more time I'm going to try splitting pnpm-lock again, and I'll try various hoisting settings until it works
g
Pulumi does not work very well with PNPM, these are my hoist settings
Copy code
public-hoist-pattern[]=@pulumi*
public-hoist-pattern[]=@aws-sdk*
public-hoist-pattern[]=@smithy*
the other option is to render JS first and then execute pulumi on rendered JS
f
We are using the automation api heavily, so hoisting it is. Thank you so much for those settings; you just saved me hours (possibly days) of trying to figure that out!