On compiling a Pulumi module, `tsc` returns an err...
# typescript
s
On compiling a Pulumi module,
tsc
returns an error in `@pulumi/pulumi`:
Copy code
node_modules/@pulumi/pulumi/queryable/index.d.ts:8:60 - error TS2304: Cannot find name 'Omit'.

8 export declare type ResolvedResource<T extends Resource> = Omit<Resolved<T>, "urn" | "getProvider">;
Package versions
1.11.0
,
1.10.0
&
1.9.0
return the same error (didn’t test others, yet).
w
What exactly is it you are trying to compile? And with what version of
tsc
? And with what tsconfig.json?
s
@white-balloon-205 Sorry for bothering. Thanks for your questions which helped 🙂 It was the too old Typescript version installed globally (
3.3.4000
) 🙈 I think
$(npm bin)/tsc
would be the better way to avoid this.
w
Got it - makes sense. Note that Pulumi itself doesn't run
tsc
for you - by default Pulumi uses a built-in version of TypeScript that it depends on via
tsnode
which should never hit the problem above. Sounds like you are opting to compile yourself - which likely is something you are doing with a build step you are managing yourself?
s
Yes. We use
tsc
as a step for publishing our NPM package which has a Pulumi class in it. Is there a way doing this with
pulumi
CLI?
Just see that this tiny bit is missing in the tutorial 😐 -> https://www.pulumi.com/blog/creating-and-reusing-cloud-components-using-package-managers/
w
I see. Yes - for reusable components and packages, definitely does make sense to run
tsc
manually, and you are right that in that case you will want to make sure to use the same version of
tsc
. My comments above were about deploying apps directly.
s
Ah, good to know that we’re on the right track, then 🙂 Are the sources for the blog posts also on Github? Or should I simply create an issue for it instead?