It doesn’t appear pulumi is recognizing a custom t...
# general
s
It doesn’t appear pulumi is recognizing a custom tsconfig.json file and I’m getting errors such as
error TS2304: Cannot find name 'APIEndpoint'
For context, APIEndpoint is an interface type in a folder in the project When I run the project outside of pulumi (using
ts watch
, etc.) these types get picked up and there’s no issue. So best I can tell when running pulumi, it doesn’t know about these files for whatever reason. I’m troubleshooting it now but any advice in the meantime?
w
Have you imported the file where
APIEndpoint
is defined into your entry point (
index.ts
)? You shouldn’t have to, but you may also try listing any additional files in the
files
section of ts config.json.
s
i didn’t import it because my assumption is I shouldn’t have to. BUT I will do it just to capture the result…see what happens.
w
For Node.js in general, you need to import modules for them to get loaded.
s
yeh but for TS stuff liek interfaces and such, if they’re in a separate file…they still get picked up by the TS compiler. Which they are if I run the compiler by itself using my config.
ok. well. that does fix that particular problem when running
pulumi
so that works. 👍
w
That’s true. For the auto-TypeScript support we use tsnode, which compiles files as it loads. Great that that works for you.