https://pulumi.com logo
#typescript
Title
# typescript
s

stocky-island-3676

02/25/2020, 4:36 PM
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

white-balloon-205

02/25/2020, 6:53 PM
What exactly is it you are trying to compile? And with what version of
tsc
? And with what tsconfig.json?
s

stocky-island-3676

02/27/2020, 5:40 PM
@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

white-balloon-205

02/27/2020, 6:54 PM
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

stocky-island-3676

02/27/2020, 6:57 PM
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

white-balloon-205

02/27/2020, 7:03 PM
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

stocky-island-3676

02/27/2020, 7:06 PM
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?
2 Views