https://pulumi.com logo
b

busy-soccer-65968

06/11/2020, 4:37 PM
i'm seeing
Copy code
Diagnostics:
  pulumi:pulumi:Stack (infrastructure-stage):
    error: Running program '/home/p/Code/ss/infrastructure' failed with an unhandled exception:
    TypeError: Class extends value undefined is not a constructor or null
        at Object.<anonymous> (/home/p/Code/ss/infrastructure/node_modules/@pulumi/helm/v3/helm.ts:125:33)
        at Module._compile (internal/modules/cjs/loader.js:1200:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
        at Module.load (internal/modules/cjs/loader.js:1049:32)
        at Function.Module._load (internal/modules/cjs/loader.js:937:14)
        at Module.require (internal/modules/cjs/loader.js:1089:19)
        at require (internal/modules/cjs/helpers.js:73:18)
        at Object.<anonymous> (/home/p/Code/ss/infrastructure/node_modules/@pulumi/helm/v3/index.ts:5:1)
        at Module._compile (internal/modules/cjs/loader.js:1200:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
on a project that hasn't changed. In CI it suceeded friday, rerunning today it fails. anythoughts on what might h ave changed. I'm using
pulumi/pulumi:latest
docker image. Any idea where to start debugging this? I've updated all packages to newest versions. Any help is greatly appreciated.
before removing node_modules locally and reinstalling with
yarn
I wasn't seeing this issue locally. So it leads me to believe something changed with dependency.
and even stranger.
Copy code
/home/p/Code/ss/infrastructure/node_modules/@pulumi/helm/v3/helm.ts:125:33
doesn't exist on my system
@gorgeous-egg-16927 πŸ™
g

gorgeous-egg-16927

06/11/2020, 4:50 PM
Yeah, https://github.com/pulumi/pulumi-kubernetes/pull/1151 was a big change, so it’s possible something broke. Would you mind opening an issue with more details?
πŸ™ 1
b

busy-soccer-65968

06/11/2020, 4:50 PM
absolutely! What type of extra detail would be helpful do you think πŸ˜….
g

gorgeous-egg-16927

06/11/2020, 4:52 PM
Ideally the code snippet with the Helm constructor and the error messages
πŸ‘ 1
b

busy-soccer-65968

06/11/2020, 4:52 PM
sadly I'm not sure which helm is causing this
from error we use many
i'll see if I can repro on a blank stack for minimal example
g

gorgeous-egg-16927

06/11/2020, 4:56 PM
Thanks!
Just noticed something odd with the import path β€” The helm package is part of the
kubernetes
package, so I would have expected
@pulumi/kubernetes/helm/v3
rather than
.../@pulumi/helm/v3/helm.ts:125:33
FWIW, I just confirmed that
helm.v3.Chart
is working for me on a fresh project. It seems like the change may have messed up node_modules somehow
b

busy-soccer-65968

06/11/2020, 5:15 PM
yeah It worked for me too with a traefik example. trying to find which part of our stack might demonstrate it.
The main reason i'm bamboozled is because in CI the only thing that could have changed is the docker image cause we use
:latest
so running a working flow from friday now fails.
and now experiencing it locally on that same stack / commit
@gorgeous-egg-16927 i've discovered the problem code that generates the error above, but no idea why. Has to do with 1 place I de-structure
Chart
on my import. Seems to happen even on blank stack. here is working / borkted code.
Copy code
import * as infra from '@myOrg/infrastructure'
import { Chart } from '@pulumi/kubernetes/helm/v2'
import * as kube from '@pulumi/kubernetes'

// get metadata for our Kubernetes cluster
const skunkworksCluster = infra.kube.getClusterData('skunkworks', 'stage')

new Chart( // <--- ERROR
    `influxdb-helmchart`,
    {
        chart: 'stable/influxdb',
        version: '1.3.4',
        values: {
            persistence: {
                storageClass: 'gp2',
                size: '250Gi'
            },
            ingress: {
                enabled: true,
                tls: false,
                hostname: 'influxdb'
            }
        }
    },
    {
        provider: skunkworksCluster.provider
    }
)

new kube.helm.v2.Chart( // <-- DOES not error
    `influxdb-helmchart`,
    {
        chart: 'stable/influxdb',
        version: '1.3.4',
        values: {
            persistence: {
                storageClass: 'gp2',
                size: '250Gi'
            },
            ingress: {
                enabled: true,
                tls: false,
                hostname: 'influxdb'
            }
        }
    },
    {
        provider: skunkworksCluster.provider
    }
)
very weird
g

gorgeous-egg-16927

06/11/2020, 8:03 PM
That is odd. Previously, the v3 import was just an alias to v2, so perhaps that change is what’s causing the error.
b

busy-soccer-65968

06/11/2020, 8:03 PM
lmk if it repros on your end. It makes me feel like i'm overlooking something, because those should be identical
g

gorgeous-egg-16927

06/11/2020, 8:03 PM
Did you try deleting
node_modules
and reinstalling?
b

busy-soccer-65968

06/11/2020, 8:03 PM
oh yeah, and yarn-upgrade-all
the above problem works on fresh stack
when I
go to definition
both
Chart
and
kube.helm.v2.Chart
take me to same place too 🀷
g

gorgeous-egg-16927

06/11/2020, 8:05 PM
Weird. I was able to repro locally as well
πŸ‘ 1
b

busy-soccer-65968

06/11/2020, 8:06 PM
Oh well it's EZ fix for my needs. Thanks for helping. I'm glad I was able to repro, but I have no clue beyond it.
πŸ‘ 1
c

careful-engine-71229

08/12/2020, 8:06 PM
I have the same issue
Trying to create a log group. Instantiating a group causes the same issue for me.
What's weird that I have 2 project on one I get that same error and the other I get no error and they have the same dependencies.