hey everyone, I've published a new version of a pa...
# typescript
v
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
were you doing local package testing?
v
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
you’re welcome! lol