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

victorious-church-57397

11/21/2022, 7:59 PM
hey everyone, I've published a new version of a package in my organization and after publishing, getting the error
TypeError: Cannot read properties of undefined (reading 'getPackage')
and can't seem to track it down. I haven't added anything from another package/library and not bumped any versions. anyone got any ideas? i've inspected the versions of the providers i have installed, output in thread
Copy code
├─ @jugo-io/jugo-pulumi-common@1.6.0
├─ @pulumi/aws@5.20.0
│  ├─ @pulumi/pulumi@^3.0.0
│  ├─ @pulumi/pulumi@3.46.1
│  │  ├─ @pulumi/query@^0.3.0
├─ @pulumi/awsx@0.40.1
│  ├─ @pulumi/docker@^3.0.0
├─ @pulumi/command@0.6.0
│  ├─ @pulumi/pulumi@^3.0.0
│  ├─ @pulumi/pulumi@3.46.1
│  │  ├─ @pulumi/query@^0.3.0
├─ @pulumi/docker@3.6.0
│  ├─ @pulumi/pulumi@^3.0.0
│  ├─ @pulumi/pulumi@3.46.1
│  │  ├─ @pulumi/query@^0.3.0
├─ @pulumi/eks@0.42.7
│  ├─ @pulumi/aws@5.10.0
│  ├─ @pulumi/aws@5.10.0
│  │  ├─ @pulumi/pulumi@^3.0.0
│  ├─ @pulumi/kubernetes@3.20.2
│  ├─ @pulumi/kubernetes@3.20.2
│  │  ├─ @pulumi/pulumi@^3.25.0
│  ├─ @pulumi/pulumi@^3.0.0
│  ├─ @pulumi/pulumi@3.46.1
│  │  ├─ @pulumi/query@^0.3.0
├─ @pulumi/kubernetes@3.22.1
│  ├─ @pulumi/pulumi@^3.25.0
│  ├─ @pulumi/pulumi@3.46.1
│  │  ├─ @pulumi/query@^0.3.0
├─ @pulumi/pulumi@3.47.1
│  ├─ @pulumi/query@^0.3.0
├─ @pulumi/query@0.3.0
Copy code
├─ @pulumi/aws@5.20.0
│  ├─ @pulumi/pulumi@^3.0.0
├─ @pulumi/awsx@0.40.1
│  ├─ @pulumi/docker@^3.0.0
├─ @pulumi/command@0.5.2
│  └─ @pulumi/pulumi@^3.0.0
├─ @pulumi/docker@3.6.0
│  ├─ @pulumi/pulumi@^3.0.0
├─ @pulumi/eks@0.42.7
│  ├─ @pulumi/aws@5.10.0
│  ├─ @pulumi/aws@5.10.0
│  │  ├─ @pulumi/pulumi@^3.0.0
│  ├─ @pulumi/kubernetes@3.20.2
│  ├─ @pulumi/kubernetes@3.20.2
│  │  ├─ @pulumi/pulumi@^3.25.0
│  ├─ @pulumi/pulumi@^3.0.0
├─ @pulumi/kubernetes@3.22.1
│  ├─ @pulumi/pulumi@^3.25.0
├─ @pulumi/pulumi@3.46.1
│  ├─ @pulumi/query@^0.3.0
├─ @pulumi/query@0.3.0
the first is the stack i'm trying to use the common lib, the second is the common lib
ah, i can see pulumi is pulled in twice under
@pulumi/aws
in the first dump, will try resolve that
nope. removing the explicit declaration for
@pulumi/pulumi
in the referencing stack doesn't seem to have fixed it after removing node_modules and reinstalling deps
full error:
Copy code
error: Running program '/home/joshrichards/workspace/repos/jugo-prometheus-inf/prometheus-inf' failed with an unhandled exception:
    TypeError: Cannot read properties of undefined (reading 'getPackage')
        at Object.expandProviders (/home/joshrichards/workspace/repos/jugo-prometheus-inf/prometheus-inf/node_modules/@pulumi/resource.ts:1014:29)
        at /home/joshrichards/workspace/repos/jugo-prometheus-inf/prometheus-inf/node_modules/@pulumi/runtime/resource.ts:540:13
        at Generator.next (<anonymous>)
        at fulfilled (/home/joshrichards/workspace/repos/jugo-prometheus-inf/prometheus-inf/node_modules/@pulumi/pulumi/runtime/resource.js:18:58)
        at processTicksAndRejections (node:internal/process/task_queues:95:5)
ive whittled it down to being a problem with the pulumi eks provider, which is declared as a peer dependency in the published package, and in the consuming stack, both the same versions
still not managed to get to the bottom of this 😞 any help would be appreciated. is anyone else having issues with the
@pulumi/eks
package?
e

elegant-crayon-4967

11/22/2022, 11:45 PM
were you doing local package testing?
v

victorious-church-57397

11/23/2022, 8:59 AM
hey man, sorry just seen this. i figured it out. i was writing a component resource class and was using a provider before id properly initialised it! all good now
e

elegant-crayon-4967

11/23/2022, 2:45 PM
you’re welcome! lol