late-balloon-24601
08/26/2025, 12:25 PMruntime:
name: nodejs
options:
nodeargs: "--import tsx"
typescript: false
Now I'm trying to use my component packages to build proper providers (so I can avoid keeping a schema up-to-date manually in my component provider) but putting that in PulumiPlugin.yaml appears to do nothing 😕late-balloon-24601
08/26/2025, 12:51 PMesbuild
to bundle it down into a commonjs file called index.ts
(hilarious, but required because pulumi seems to ignore main
in package.json if it's a js file, and disabling typescript in PulumiPlugin.yaml doesn't work)
• Copying my package.json
and specifying that as the entrypoint
• Adding // @ts-nocheck
to the top of index.ts
to stop the typescript compilation from failing
The build process I usually use for my typescript component provider which excludes a bunch of packages seems to not work with the pulumi install
method, so I have a nice healthy 100mb pseudo-typescript file that takes an age to install and sadly fails on something later on
Installing packages defined in Pulumi.yaml...
Installing package 'ebx-github'...
error: Detected that ../../components/github/provider exited prematurely.
This is *always* a bug in the provider. Please report the issue to the provider author as appropriate.
To assist with debugging we have dumped the STDOUT and STDERR streams of the plugin:error: [runtime] Running program '/home/connor/echobox/repos/infrastructure-common-sdk/pulumi/components/github/provider' failed with an unhandled exception:
/home/connor/echobox/repos/infrastructure-common-sdk/pulumi/components/github/provider/index.ts:306596
super.write(root);
^^^^^
SyntaxError: 'super' keyword unexpected here
error: installing `packages` from Pulumi.yaml: failed to install package 'ebx-github': failed to get schema: could not read plugin [../../components/github/provider]: Program exited with non-zero exit code: 32
Let's see if I can get tsc to play ball instead 🤔white-camera-67848
08/26/2025, 2:08 PMPulumiPlugin.yaml
with the contents:
runtime:
name: nodejs
options:
nodeargs: "--import tsx"
typescript: false
white-camera-67848
08/26/2025, 2:08 PMlate-balloon-24601
08/26/2025, 2:09 PM"type": "module"
in the package.json?white-camera-67848
08/26/2025, 2:09 PMlate-balloon-24601
08/26/2025, 2:09 PMwhite-camera-67848
08/26/2025, 2:12 PMlate-balloon-24601
08/26/2025, 2:15 PMPulumi.yaml
- a yaml runtime application with a local filesystem ref to the components package
name: ebx-github
runtime: yaml
packages:
ebx-github:
source: '../../components/github'
../../components/github
contains `PulumiPlugin.yaml`:
runtime:
name: nodejs
options:
nodeargs: '--import tsx'
typescript: false
plus the package.json
defining an esm module package
Install gives me a an error related to ESM imports not working, which implies that tsx isn't being executed (though I can't actually confirm that)
pulumi install
Installing packages defined in Pulumi.yaml...
Installing package 'ebx-github'...
error: Detected that ../../components/github exited prematurely.
This is *always* a bug in the provider. Please report the issue to the provider author as appropriate.
To assist with debugging we have dumped the STDOUT and STDERR streams of the plugin:error: [runtime] Running program '/home/connor/echobox/repos/infrastructure-common-sdk/pulumi/components/github' failed with an unhandled exception:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/connor/echobox/repos/infrastructure-common-sdk/pulumi/components/github/src/index.ts
require() of ES modules is not supported.
require() of /home/connor/echobox/repos/infrastructure-common-sdk/pulumi/components/github/src/index.ts from /home/connor/echobox/repos/infrastructure-common-sdk/node_modules/@pulumi/pulumi/cmd/run-plugin/run.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from /home/connor/echobox/repos/infrastructure-common-sdk/pulumi/components/github/package.json.
at createErrRequireEsm (/home/connor/echobox/repos/infrastructure-common-sdk/node_modules/ts-node/dist-raw/node-internal-errors.js:46:15)
at assertScriptCanLoadAsCJSImpl (/home/connor/echobox/repos/infrastructure-common-sdk/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js:584:11)
at Object.require.extensions.<computed> [as .ts] (/home/connor/echobox/repos/infrastructure-common-sdk/node_modules/ts-node/src/index.ts:1610:5)
at Module.load (node:internal/modules/cjs/loader:1470:32)
at Module._load (node:internal/modules/cjs/loader:1290:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:238:24)
at Module.require (node:internal/modules/cjs/loader:1493:12)
at require (node:internal/modules/helpers:152:16)
at runProgram (/home/connor/echobox/repos/infrastructure-common-sdk/node_modules/@pulumi/cmd/run-plugin/run.ts:279:31) {
code: 'ERR_REQUIRE_ESM'
}
late-balloon-24601
08/26/2025, 2:18 PMts-node
, which by default doesn't support esm modules. I previously used ts-node/esm
, but found it very finnicky. In a normal Pulumi.yaml
, the typescript: false
option disables ts-node
, so it looks like it isn't honoured in PulumiPlugin.yaml
?white-camera-67848
08/26/2025, 2:21 PM@pulumi/pulumi
package do you have?white-camera-67848
08/26/2025, 2:22 PMlate-balloon-24601
08/26/2025, 2:23 PMv3.191.0
on the CLI and 3.187.0
on the pulumi/pulumi package. I'll compare my setup to yours and see if I can reproduce in a less complex repo (my current one)white-camera-67848
08/26/2025, 2:23 PMwhite-camera-67848
08/26/2025, 2:24 PM--import
in nodeargs should disable the ts-node loader we ship with pulumi.white-camera-67848
08/26/2025, 2:26 PMwhite-camera-67848
08/26/2025, 2:26 PMlate-balloon-24601
08/26/2025, 2:27 PMwhite-camera-67848
08/26/2025, 2:38 PMlate-balloon-24601
08/26/2025, 2:41 PMwhite-camera-67848
08/26/2025, 2:42 PMlate-balloon-24601
08/26/2025, 2:42 PMwhite-camera-67848
08/26/2025, 2:43 PMlate-balloon-24601
08/26/2025, 2:43 PMlate-balloon-24601
08/26/2025, 2:58 PM