Upgrading to `@pulumi/pulumi=1.8.1` with typescrip...
# general
m
Upgrading to
@pulumi/pulumi=1.8.1
with typescript has introduced this error for me:
Copy code
stacks/cluster/api.ts(85,8): error TS2345: Argument of type '{ parent: this; }' is not assignable to parameter of type 'CustomResourceOptions'.
      Types of property 'parent' are incompatible.
        Type 'this' is not assignable to type 'Resource | undefined'.
          Type 'this' is not assignable to type 'Resource'
where
this
is a
class API extends pulumi.ComponentResource
w
This is most likely a result of having two different versions of
@pulumi/pulumi
being loaded. Can you check you package-lock.json to see if there are two versions? Can you to an upgrade of the older one to force it to pick up 1.8.1 as well? (That said - it is not expected that we give this error - we work hard to ensure we never break side-by-side compatibility - if you do have another version in your lock file - would be great to know what version it is so we can look into why there was this incompatibility between those two versions).
m
Here is what I have installed right now causing the issue:
Copy code
❯ yarn list @pulumi/pulumi
yarn list v1.21.1
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ @pulumi/kubernetesx@0.1.1
│  └─ @pulumi/pulumi@1.6.1
├─ @pulumi/pulumi@1.7.0
└─ infrastructure@1.0.0
   ├─ @pulumi/kubernetes@1.4.1
   │  └─ @pulumi/pulumi@1.7.0
   └─ @pulumi/pulumi@1.8.1
:sparkles:  Done in 0.37s.
Updating my lockfile to force everything on 1.8.1 did seem to work I think
p
@white-balloon-205, I’ve seen this issue happen a lot in our monorepo since we have Pulumi installed in multiple packages. Should packages like
@pulumi/kubernetes
have
@pulumi/pulumi
as a peer dependency instead of a normal dependency?
w
We would love to try to use peerDependencies to resolve this class of issues. It’s a little difficult as we will have to move the entire ecosystem away from normal dependencies for it to work - but we do expect this is where we need to get eventually.
p
Nice. And yeah, making a change like that would have to happen in a major release. Good to hear y’all are planning for it though 😄
w
@millions-judge-24978 good to hear that fixed it and sorry for the trouble. The 1.7.0 release actually introduced an incompatibility which causes this, and we fixed that in 1.7.1. That leads to 1.7.0 being incompatible side-by-side with everything before it but also everything after it. So sounds like there is no new issue here - just another impact of the issue that was already fixed in 1.7.1. https://github.com/pulumi/pulumi/blob/master/CHANGELOG.md#171-2019-12-13
👍 1