Hi folks! On one of my stacks I'm hitting what loo...
# typescript
f
Hi folks! On one of my stacks I'm hitting what look to be Protobuf errors with the typescript SDK. đź§µ
Copy code
$ AWS_PROFILE=dev pulumi preview --stack <my-org>/dev
Previewing update (<my-org>/dev)

View in Browser (Ctrl+O): <https://app.pulumi.com/><my-org>/<my-project>/dev/previews/<UUID>

     Type                 Name              Plan     Info
     pulumi:pulumi:Stack  <my-project>-dev           5 errors

Diagnostics:
  pulumi:pulumi:Stack (<my-project>-dev):
    error: Running program '/home/aru/code/infrastructure/stacks/<my-project>/' failed with an unhandled exception:
    <ref *1> TypeError: c.g is not a function
        at Function.N.setWrapperField (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/google-protobuf/google-protobuf.js:91:66)
        at proto.pulumirpc.ResourceInvokeRequest.setArgs (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/proto/resource_pb.js:4193:23)
        at /home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/runtime/invoke.ts:386:9
        at Generator.next (<anonymous>)
        at /home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/runtime/invoke.js:21:71
        at new Promise (<anonymous>)
        at __awaiter (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/runtime/invoke.js:17:12)
        at createInvokeRequest (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/runtime/invoke.js:308:12)
        at /home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/runtime/invoke.ts:293:27
        at Generator.next (<anonymous>) {
      promise: Promise { <rejected> [Circular *1] }
    }
    error: Running program '/home/aru/code/infrastructure/stacks/<my-project>/' failed with an unhandled exception:
    <ref *1> TypeError: c.g is not a function
        at Function.N.setWrapperField (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/google-protobuf/google-protobuf.js:91:66)
        at proto.pulumirpc.ReadResourceRequest.setProperties (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/proto/resource_pb.js:1152:23)
        at Object.<anonymous> (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/runtime/resource.ts:348:21)
        at Generator.next (<anonymous>)
        at fulfilled (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/runtime/resource.js:18:58) {
      promise: Promise { <rejected> [Circular *1] }
    }
    error: Running program '/home/aru/code/infrastructure/stacks/<my-project>/' failed with an unhandled exception:
    <ref *1> TypeError: c.g is not a function
        at Function.N.setWrapperField (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/google-protobuf/google-protobuf.js:91:66)
        at proto.pulumirpc.ReadResourceRequest.setProperties (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/proto/resource_pb.js:1152:23)
        at Object.<anonymous> (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/runtime/resource.ts:348:21)
        at Generator.next (<anonymous>)
        at fulfilled (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/runtime/resource.js:18:58) {
      promise: Promise { <rejected> [Circular *1] }
    }
    error: Running program '/home/aru/code/infrastructure/stacks/<my-project>/' failed with an unhandled exception:
    <ref *1> TypeError: c.g is not a function
        at Function.N.setWrapperField (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/google-protobuf/google-protobuf.js:91:66)
        at proto.pulumirpc.RegisterResourceRequest.setObject (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/proto/resource_pb.js:2541:23)
        at Object.<anonymous> (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/runtime/resource.ts:564:21)
        at Generator.next (<anonymous>)
        at fulfilled (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/runtime/resource.js:18:58) {
      promise: Promise { <rejected> [Circular *1] }
    }
    error: Running program '/home/aru/code/infrastructure/stacks/<my-project>/' failed with an unhandled exception:
    <ref *1> TypeError: c.g is not a function
        at Function.N.setWrapperField (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/google-protobuf/google-protobuf.js:91:66)
        at proto.pulumirpc.RegisterResourceRequest.setObject (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/proto/resource_pb.js:2541:23)
        at Object.<anonymous> (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/runtime/resource.ts:564:21)
        at Generator.next (<anonymous>)
        at fulfilled (/home/aru/code/infrastructure/stacks/<my-project>/node_modules/@pulumi/pulumi/runtime/resource.js:18:58) {
      promise: Promise { <rejected> [Circular *1] }
    }

Resources:
    1 unchanged
Copy code
$ protoc --version
libprotoc 30.0
Copy code
$ node --version
v23.4.0
I've tried reinstalling the node deps, as well as my Pulumi plugins
b
Do you have any resolutions pinning the version of any dependencies in your package.json?
if not, I would look at your
tsconfig.json
file – have you changed anything?
your installed
protoc
version shouldn’t matter at all, but the Node version might – though Node 23.4.0 works fine in my project
does this only happen in a single stack, a single project, or in all your projects?
r
this is a problem with google protobuf library, I just added patch that fixes in on my repo, just use
npx patch-package
f
Thanks folks! This is only happening on one of my projects. I'm busy with something else, but I'll give it a shot next week.
Unfortunately that patch didn't address the issue. It came down to a bad set of modules being resolved, so I massaged my package-lock.json resolutions (locking older versions of most protobuf-related packages) until the error went away.