https://pulumi.com logo
#general
Title
# general
b

best-xylophone-83824

08/19/2019, 9:23 AM
What I am doing wrong? test.ts file:
Copy code
import * as gcp from "@pulumi/gcp";
const x = {} as gcp.container.NodePoolArgs["nodeConfig"]["labels"];
Then
Copy code
$ node_modules/.bin/tsc --noEmit --noErrorTruncation test.ts
test.ts:2:58 - error TS2339: Property 'labels' does not exist on type 'Input<{ diskSizeGb?: .....; labels?: Input<{ [key: string]: Input<string>; }>;'
how come?
labels
is clearly there 🙂
Works with
pulumi.Unwrap
, but IMHO it should be needed:
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const x = {} as pulumi.Unwrap<gcp.container.NodePoolArgs>["nodeConfig"]["labels"];
Hm, Unwrap helps reproducer, but actual code still fails when it is part of a whole project compilation, WTF? compiling just a file:
Copy code
$ node_modules/.bin/tsc --noEmit   nodepool.ts
# no errror
Compiling whole project:
Copy code
$ node_modules/.bin/tsc --noEmit

nodepools.ts:37:111 - error TS2339: Property 'labels' does not exist on type 'UnwrappedObject<{ diskSizeGb?: ...