Hi folks. I've started reworking a dated pulumi re...
# typescript
f
Hi folks. I've started reworking a dated pulumi repo which calls for the sdk update itself (used to be 1.x yikes) that I need to handle to be able to leverage the terraform-provider bridge thing. However, when updating the pulumi sdk to latest 3 version I am getting the infamous
ERR_UNKNOWN_FILE_EXTENSION
error. I cannot get rid of
"type":module
in package json because that will error out when trying to use top lvl await which I also want to take advantage of during refactor. Is there any
actually confirmed to work
approach to sorting this out? I tested node 18, 19 and 21 - no difference. I can provide package.json and tsconfig.json files if necessary to discuss this (as I am not the one who originally started this repo config - everything is up for a debate).
l
Is this in the Pulumi project, or in the SDK project? If it's the Pulumi project, have you configured your node runtimes' nodeargs? I use this currently, YMMV:
Copy code
runtime:
  name: nodejs
  options:
    nodeargs: "--loader ts-node/esm --no-warnings --experimental-specifier-resolution=node"
f
hey @little-cartoon-10569, thanks for taking the time, I tired those args and they did not help. what actually helped was ... replacing ts-node (as I understand) with tsx altogether by adding
--import tsx
to node args. thanks to @bland-processor-73185 leaving a trace on github not sure how futureproof that approach is but it seems to tick all of the boxes for me which is being able to use latest node, ESM module type in package json and still leverage top lvl awaits
l
Yea tsx is great. I should change. I'm kinda hoping that Pulumi becomes properly bun-compatible, and I can skip tsx and go straight to bun!