It doesn’t appear pulumi is recognizing a custom t...
# general
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?
Have you imported the file where
is defined into your entry point (
)? You shouldn’t have to, but you may also try listing any additional files in the
section of ts config.json.
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.
For Node.js in general, you need to import modules for them to get loaded.
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
so that works. 👍
That’s true. For the auto-TypeScript support we use tsnode, which compiles files as it loads. Great that that works for you.