https://pulumi.com logo
#general
Title
# general
b

better-rainbow-14549

03/17/2020, 1:31 PM
i'm also getting
unexpected struct type
trying to return a generated output from a dynamic provider... any ideas?
w

white-balloon-205

03/17/2020, 2:50 PM
When you say “return a generated output” what exactly do you mean?
b

better-rainbow-14549

03/17/2020, 2:50 PM
i'm calling an API and it generates a token, i wanted to expose that as a property of the dynamic resource
but then i remembered i've had this before - and it needs a public readonly memberName: pulumi.Output<string>; on the resource class
and it gets filled out automatically, provided you pass that in as the input block to the provider constructor
so i think i've fixed it now
w

white-balloon-205

03/17/2020, 2:52 PM
Got it. If you have a repro of what you did that triggered that error originally - I’d love to see it. At the very least it should be a better error message.
b

better-rainbow-14549

03/17/2020, 2:53 PM
i think its actually related to a confusing type annotation on child_process.spawnSync - the return type has stdout: string on it, but in reality it's a Buffer
so i was returning that buffer to the pulumi.Output<string> and then getting a protobuf fail
49 Views