Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SxS issue with @pulumi/pulumi introduced in 1.7.0 #3652

Closed
lukehoban opened this issue Dec 12, 2019 · 6 comments
Closed

SxS issue with @pulumi/pulumi introduced in 1.7.0 #3652

lukehoban opened this issue Dec 12, 2019 · 6 comments
Assignees
Labels
p1 A bug severe enough to be the next item assigned to an engineer
Milestone

Comments

@lukehoban
Copy link
Member

lukehoban commented Dec 12, 2019

We have seen a couple reports of issues when users have 1.7.0 sxs with earlier versions (like 1.6.1). This can lead to incompatibilities between Output<T> in the newer and older libraries. Feels like this is most likely related to this change.

  error: Running program '/home/p/Code/ss/something' 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/something/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<string>' is not assignable to type 'import("/home/p/Code/ss/something/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/something/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("/home/p/Code/ss/something/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/something/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("/home/p/Code/ss/something/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/home/p/Code/ss/something/node_modules/@pulumi/pulumi/output").Ou...'.
                Type 'import("/home/p/Code/ss/something/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("/home/p/Code/ss/something/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/something/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").OutputInstance<any>' is not assignable to type 'import("/home/p/Code/ss/something/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/something/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("/home/p/Code/ss/something/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/something/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("/home/p/Code/ss/something/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("/home/p/Code/ss/something/node_modules/@pulumi/pulumi/output").Output<....'.
                            Type 'import("/home/p/Code/ss/something/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("/home/p/Code/ss/something/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/something/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/output").Output<string>' is not assignable to type 'import("/home/p/Code/ss/something/node_modules/@pulumi/pulumi/output").Output<string>'.
          Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
        at createTSError (/home/p/Code/ss/something/node_modules/ts-node/src/index.ts:261:12)
        at getOutput (/home/p/Code/ss/something/node_modules/ts-node/src/index.ts:367:40)
        at Object.compile (/home/p/Code/ss/something/node_modules/ts-node/src/index.ts:558:11)
        at Module.m._compile (/home/p/Code/ss/something/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/something/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)
@lukehoban lukehoban added the p1 A bug severe enough to be the next item assigned to an engineer label Dec 12, 2019
@lukehoban lukehoban added this to the 0.30 milestone Dec 12, 2019
@lukehoban
Copy link
Member Author

Marking P1 until we identify how broad of an issue this is. Several reports of this in the first 24 hours 1.7.0 has been out.

@lukehoban
Copy link
Member Author

Users who saw this indicated that blowing away node_modules and yarn.lock/package-lock.json and reinstalling dependencies does fix things.

@juchom
Copy link

juchom commented Dec 13, 2019

Not sure if this is related but I had this issue today:

pulumi:pulumi:Stack (qa):
  error: Running program 'E:\VSTS\agent-work\r20\a\_artifacts\iac.11778' failed with an unhandled exception:
  TSError: ⨯ Unable to compile TypeScript:
  index.ts(247,43): error TS2322: Type 'Output<string>' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'.
    Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
      Types of property 'apply' are incompatible.
        Type '{ <U>(func: (t: string) => Promise<U>): import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/azure/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/azure/node_modules/@pulumi/pulumi/output").Outpu...' is not assignable to type '{ <U>(func: (t: string) => Promise<U>): import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: string) => import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("E:/VSTS/agent-work/r20/a/_artif...'.
          Type 'import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/azure/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/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> & LiftedArray<{}>'.
                Type 'import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/azure/node_modules/@pulumi/pulumi/output").OutputInstance<any>' is not assignable to type 'import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/pulumi/output").OutputInstance<any>'.
                  Types of property 'apply' are incompatible.
                    Type '{ <U>(func: (t: any) => Promise<U>): import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/azure/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/azure/node_modules/@pulumi/pulumi/output").OutputInsta...' is not assignable to type '{ <U>(func: (t: any) => Promise<U>): import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/pulumi/output").Output<U>; <U>(func: (t: any) => import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/pulumi/output").OutputInstance<U>): import("E:/VSTS/agent-work/r20/a/_artifacts/i...'.
                      Type 'import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/node_modules/@pulumi/azure/node_modules/@pulumi/pulumi/output").Output<any>' is not assignable to type 'import("E:/VSTS/agent-work/r20/a/_artifacts/iac.11778/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> & LiftedArray<{}>'.
                            Property 'length' is missing in type 'OutputInstance<any>' but required in type 'LiftedArray<{}>'.
  index.ts(247,57): error TS2322: Type 'Output<string>' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'.
    Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
  index.ts(247,94): error TS2322: Type 'Output<string>' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'.
    Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
  index.ts(247,146): error TS7031: Binding element 'sbName' implicitly has an 'any' type.
  index.ts(247,154): error TS7031: Binding element 'policyName' implicitly has an 'any' type.
  index.ts(247,166): error TS7031: Binding element 'policyKey' implicitly has an 'any' type.
  index.ts(250,43): error TS2322: Type 'Output<string>' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'.
    Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
  index.ts(250,57): error TS2322: Type 'Output<string>' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'.
    Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
  index.ts(250,87): error TS2322: Type 'Output<string>' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'.
    Type 'Output<string>' is not assignable to type 'OutputInstance<string>'.
  index.ts(250,132): error TS7031: Binding element 'sbName' implicitly has an 'any' type.
  index.ts(250,140): error TS7031: Binding element 'policyName' implicitly has an 'any' type.
  index.ts(250,152): error TS7031: Binding element 'policyKey' implicitly has an 'any' type.

Same code with tsc 3.4.1 works fine, after an update to tsc 3.7.3 this issue happens.

I confirm that after deleting package-lock.json and node_modules it works.

@CyrusNajmabadi
Copy link
Contributor

i'll look into this. it sounds like tsc might have gotten stricter and something we do in our typings makes it unhappy. I've also seen something similar in a downstream lib. This line is pretty interesting:

'OutputInstance<any> & LiftedArray<{}>'

I think something is getting inferred as object (i.e. {}) instead of any and we're seeing a conflict. This happened downstream in own own libs where a previous any got inferred as unknown.

--

This doesn't seem super high pri though given that it is fixable by unlocking things.

@CyrusNajmabadi
Copy link
Contributor

I have figured this out. An unfortunate confluence of a change i made and TS 3.7 getting stricter. Will fix asap.

@CyrusNajmabadi
Copy link
Contributor

Fixed with #3658. Will be trying to get this out asap to a 1.7.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 A bug severe enough to be the next item assigned to an engineer
Projects
None yet
Development

No branches or pull requests

3 participants