sparse-intern-71089
05/16/2022, 7:59 PMminiature-musician-31262
05/17/2022, 12:03 AMbrave-scientist-99340
05/17/2022, 3:46 PMminiature-musician-31262
05/18/2022, 12:28 AM'() => provider': index.js(28,47): captured
variable 'provider' which indirectly referenced
function 'create': edge-node-provider.ts(36,10): which captured
variable 'prisma' which indirectly referenced
'(userArgs) => { const callsite = get ...': index.js(42810,9): which captured
variable 'client' which indirectly referenced
function 'setMaxListeners': which captured
'NumberIsNaN', a function defined at
function 'isNaN': which could not be serialized because
it was a native code function.
Function code:
function isNaN() { [native code] }
miniature-musician-31262
05/18/2022, 12:30 AMprisma.node.create
ultimately calls into the native JS function isNaN
, which can’t be serialized: https://www.pulumi.com/docs/intro/concepts/function-serialization/#known-limitations-when-capturing-values
this limitation is also mentioned in the dynamic providers documentation: https://www.pulumi.com/docs/intro/concepts/resources/dynamic-providers/#how-dynamic-providers-workminiature-musician-31262
05/18/2022, 12:33 AMbrave-scientist-99340
05/18/2022, 12:00 PMbrave-scientist-99340
05/18/2022, 12:02 PMbrave-scientist-99340
05/19/2022, 11:20 AMasync create(inputs: EdgeNodeInputs) {
const proc = execFileSync("dist/lifecycle.js", [
"create",
JSON.stringify([inputs]),
]);
return JSON.parse(proc.toString());
},
async delete(id, props: Node) {
const proc = execFileSync("dist/lifecycle.js", [
"delete",
JSON.stringify([id, props]),
]);
return JSON.parse(proc.toString());
},
Basically, I moved all of the critical code into a different file that is also compiled and just execute it 🙂 .
Its a bit hacky but it works great. Also it allows me greater control than the local.Command
miniature-musician-31262
05/19/2022, 1:49 PMminiature-musician-31262
05/19/2022, 1:49 PM