generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
I followed the documentation here: https://github.com/aws-samples/amazon-cognito-passwordless-auth/blob/main/CUSTOMIZE-AUTH.md to setup custom email templates and ran into an error
SyntaxError: Cannot use import statement outside a module.
This was fixed by adding:
import * as lambdaNodeJs from "aws-cdk-lib/aws-lambda-nodejs";
createAuthChallenge: {
entry: "functions/src/passwordless/createAuthChallenge.ts",
bundling: {
format: lambdaNodeJs.OutputFormat.ESM,
banner: "import{createRequire}from 'module';const require=createRequire(import.meta.url);",
},
},
Looks like it needs ESM to use the import syntax.
sparksoftltd
Metadata
Metadata
Assignees
Labels
No labels