acoustic-arm-10406
08/19/2021, 6:29 PMimport * as awsx from "@pulumi/awsx";
https://www.pulumi.com/docs/guides/crosswalk/aws/api-gateway/#defining-a-lambda-function-event-handler-route
When I do pulumi up
It's saying I have to use require
because of a node_module from pulumi is using require. I would like to use import instead of refactoring all my code to use require
Error:
require() of /index.js from /node_modules/@pulumi/pulumi/cmd/run/run.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /package.json.
little-cartoon-10569
08/19/2021, 10:08 PM"type":"module"
even if your runtime is node14. Don't know why. So if you want to create a pure JS package for your lambdas, you either need to use commonJS, or transpile down to that. I don't know how to transpile JS->JS; the TS->JS transpilation done with Pulumi's default config has always worked for me.acoustic-arm-10406
08/20/2021, 4:25 PM