Hi, it might be a stupid question but any way to d...
# typescript
m
Hi, it might be a stupid question but any way to do top level await in a pulumi program (index.ts file). It compiles fine but failed when running it with pulumi up
l
I think you just need to set your Typescript target and module values to whatever's required for that. IIRC is might be esnext and es2018, or newer?
m
It's what I did, it made the code compile on vscode. But failed when running pulumi up
l
Ah yes, you need to override Pulumi's configuration, I forgot that part. Onesec I'll get the link
The link is here: https://www.pulumi.com/docs/languages-sdks/javascript/#disabling-built-in-typescript-support However I've just checked in some of my projects and I don't use that. Apparently this also works:
Copy code
runtime:
  name: nodejs
  options:
    nodeargs: "--loader ts-node/esm --no-warnings"
m
nice, thanks!