Did anyone run into this problem?
# general
c
Did anyone run into this problem?
w
That doesn’t look familiar. Is there any more context? Do you have a repro you could share?
c
I’m not at my computer but I can try to build one when I get to my computer — i did try a fresh example with a template and it works, so it might be the way my code is structured. I’m also not super experienced in typescript modules and so on so i might be doing something stupid. Actually would you mind having a quick look if I added you as a collaborator to the private repo in the meantime?
(I did read https://pulumi.io/reference/serializing-functions/ and even though it references the deprecated serverless package, it seems reasonable and I think I’m not doing anything that could mess up serialisation)
back in my computer. the generated code start like this:
Copy code
exports.handler = __importYoutube;

var __module = {exports: require("child_process")};
var __exec_sym = Object.create(global.Symbol.prototype);
__exec[__exec_sym] = __f1;
__f1[__exec_sym] = __f1;
in this case the error backtrace comes from
__exec[__exec_sym] = __f1;
, the 5th line
w
I would love to see your source code - do feel free to add me and I'll take a look. Note that it does appear that you are ending up serializing parts of the builtin libraries into your code - that shouldn't be necessary - and most likely it is possible to accomplish your goals without this. But will be useful to see your code to understand how you ended up getting here.
c
I simplified my code and in general separating the deploy time vs runtime values helped a lot!