Are these files put in a different (output) directory than your normal .ts files? Or are they in the same directory?
Pulumi uses ts-node by default, and reads files from the source directory, not the outDir configured in tsconfig.json. If you're putting your .d.ts files in the outDir, alongside .js and .d.ts files transpiled by tsc, then Pulumi won't see them.
If this is the case, you can either put your .d.ts files in the source directory, or configure Pulumi not to use ts-node.
https://www.pulumi.com/docs/intro/languages/javascript/#disabling-built-in-typescript-support
c
careful-book-62830
12/08/2022, 11:06 AM
Thank you. This works, but need to build app every time before runnig pulumi
l
little-cartoon-10569
12/08/2022, 7:14 PM
You can put the .d.ts files in your source directory, then you won't need to rebuild. Pulumi uses ts-node, which has no transpile step, it runs directly from the .ts files. You need to make your .d.ts files findable for ts-node.
c
careful-book-62830
12/13/2022, 6:03 PM
it was in there and no luck.
l
little-cartoon-10569
12/13/2022, 8:14 PM
Ah. I don't know then. Maybe the ts-node docs explain how to get this working? It's almost certainly not a Pulumi-specific problem, it's about how the auto-transpilation thing in ts-node finds files and makes them available to the JS engine...
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.