astonishing-cartoon-37000
12/12/2019, 5:55 PMComponentResourceOptions
? i'm getting
index.ts(29,47): error TS2322: Type 'Provider' is not assignable to type 'ProviderResource'.
Types of property 'id' are incompatible.
when trying to
const k8sProvider = new k8s.Provider(`cointainers-${environment}`, {
kubeconfig: fs.readFileSync(`.circleci/${environment}.json`).toString()
})
const t = new test({provider: k8sProvider}) // <---- pass provider as options to class which extends pulumi.ComponentResource
class test extends pulumi.ComponentResource {
constructor(opts?: pulumi.ComponentResourceOptions) {
super('test', "test", {}, opts)
}
}
"@pulumi/pulumi": "^1.7.0",
"@pulumi/kubernetes": "^1.4.0",
white-balloon-205
12/12/2019, 6:06 PMid
on the two types in question?astonishing-cartoon-37000
12/12/2019, 6:06 PMerror: Running program '/home/p/Code/ss/cointainers' failed with an unhandled exception:
TSError: ⨯ Unable to compile TypeScript:
index.ts(29,47): error TS2322: Type 'Provider' is not assignable to type 'ProviderResource'.
Types of property 'id' are incompatible.
Type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<string>' is not assignable to type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<string>'.
Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
Types of property 'apply' are incompatible.
Type '{ <U>(func: (t: string) => Promise<U>): import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/ho...' is not assignable to type '{ <U>(func: (t: string) => Promise<U>): import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Ou...'.
Type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<any>'.
Type 'OutputInstance<any>' is not assignable to type 'Output<any>'.
Type 'OutputInstance<any>' is not assignable to type 'OutputInstance<any> & LiftedObject<any, string>'.
Type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").OutputInstance<any>' is not assignable to type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").OutputInstance<any>'.
Types of property 'apply' are incompatible.
Type '{ <U>(func: (t: any) => Promise<U>): import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/home/p/C...' is not assignable to type '{ <U>(func: (t: any) => Promise<U>): import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<....'.
Type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<any>'.
Type 'OutputInstance<any>' is not assignable to type 'Output<any>'.
Type 'OutputInstance<any>' is not assignable to type 'OutputInstance<any> & LiftedObject<any, string>'.
Type 'OutputInstance<any>' is not assignable to type 'LiftedObject<any, string>'.
Index signature is missing in type 'OutputInstance<any>'.
index.ts(44,15): error TS2322: Type 'Repository' is not assignable to type 'Resource'.
Types of property 'urn' are incompatible.
Type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<string>' is not assignable to type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<string>'.
Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
at createTSError (/home/p/Code/ss/cointainers/node_modules/ts-node/src/index.ts:261:12)
at getOutput (/home/p/Code/ss/cointainers/node_modules/ts-node/src/index.ts:367:40)
at Object.compile (/home/p/Code/ss/cointainers/node_modules/ts-node/src/index.ts:558:11)
at Module.m._compile (/home/p/Code/ss/cointainers/node_modules/ts-node/src/index.ts:439:43)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/p/Code/ss/cointainers/node_modules/ts-node/src/index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
white-balloon-205
12/12/2019, 6:13 PMastonishing-cartoon-37000
12/12/2019, 6:13 PMwhite-balloon-205
12/12/2019, 6:15 PM@pulumi/pulumi
- see this:
Type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<string>' is not assignable to type 'import("/home/p/Code/ss/cointainers/node_modules/@pulumi/pulumi/output").Output<string>'.
Note that you have one copy nested under @pulumi/kubernetes
and one at top level in your node_modules.
If you npm upgrade @pulumi/pulumi
I suspect it will fix it - as would blowing away node_modules
and package-lock.json
and reinstalling dependencies.@pulumi/pulumi
) works without problems. It looks like somehow that is not the case here - which is the issue I would like to have a bug tracking so that we can fix it.astonishing-cartoon-37000
12/12/2019, 6:18 PMrm -rf node_modules && yarn-upgrade-all && yarn
which gave me this behavior. Wouldn't that be close to equivelent of npm ugprade @pulumi/pulumi
white-balloon-205
12/12/2019, 6:24 PMokay interestingly enough a fresh project doesn't seem to have same problem.Yes - that's what I'd expect. I'd bet in a fresh project you do not have a nested copy of
@pulumi/pulumi
inside your @pulumi/kubernetes
package in node_modules
. NPM/yarn is much better at unifying dependencies on fresh install than on incremental updates unfortunately.astonishing-cartoon-37000
12/12/2019, 6:26 PMwhite-balloon-205
12/12/2019, 6:52 PMastonishing-cartoon-37000
12/12/2019, 8:33 PMlimited-rain-96205
12/14/2019, 12:14 AMwhite-balloon-205
12/14/2019, 4:59 AM@pulumi/pulumi
with a fix for this issue earlier today - combinations of 1.7.1 with previous versions should work fine again. Thanks!
https://www.npmjs.com/package/@pulumi/pulumi/v/1.7.1