I have defined an aws lambda callback function via...
# typescript
I have defined an aws lambda callback function via pulumi and when i attempt to deploy via pulumi up I get an error with one of my imports (p-retry):
Error [ERR_REQUIRE_ESM]: require() of ES Module"
I haven’t had any issues prior to this. I’ve tried turning my project into a module and tried to tweak tsconfig module and target, but am having no luck. I’d greatly appreciate any advise on how to solve this or generally allow
type: module
in package json to work for pulumi projects.
If you are using 3rd party dependencies serialized callbackFunction does not work really good. I suggest to build the function as a separate package then use
https://www.pulumi.com/docs/concepts/inputs-outputs/assets-archives/ then you end up with 2 step build but it is worth it. callBackFunction gives a lot of headaches