PostConfirmation failed with error index.handler is undefined or not exported.
See original GitHub issueDescribe the bug
amplifyXXXXXXPostConfirmation
Lambdaindex.js
andevent.js
generated in incorrect directory.- Error occured when call
Auth.confirmSignUp
aws-amplify API
PostConfirmation failed with error index.handler is undefined or not exported.
Amplify CLI Version 4.17.2
To Reproduce
amplify auth update
What do you want to do?
Walkthrough all the auth configurations
Select the authentication/authorization services that you want to use:
User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more)
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM)
Yes
Do you want to enable 3rd party authentication providers in your identity pool?
No
Do you want to add User Pool Groups?
No
Do you want to add an admin queries API?
No
Multifactor authentication (MFA) user login options:
OFF
Email based user registration/forgot password:
Enabled (Requires per-user email entry at registration)
Please specify an email verification subject:
Your verification code
Please specify an email verification message:
Your verification code is {####}
Do you want to override the default password policy for this User Pool?
No
Specify the app's refresh token expiration period (in days):
30
Do you want to specify the user attributes this app can read and write?
No
Do you want to enable any of the following capabilities?
Do you want to use an OAuth flow?
No
? Do you want to configure Lambda Triggers for Cognito?
Yes
? Which triggers do you want to enable for Cognito
Post Confirmation
? What functionality do you want to use for Post Confirmation
Create your own module
- call
Auth.signUp
aws-amplify API
Expected behavior
amplifyXXXXXXPostConfirmation
Lambdaindex.js
andevent.js
generated insrc
directory.- Success call
Auth.confirmSignUp
aws-amplify API
Screenshots
Desktop (please complete the following information):
- OS: [Ubuntu]
- Node Version. [v12.14.1]
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
aws lambda - Index handler is undefined or not exported
I have a lambda function which was working fine but I wanted to import a package so I created a directory with index.js...
Read more >AWS Lambda + Node: index.handler is not defined
If you get an “index.handler is undefined” error on AWS lambda, it could be one of a couple things – essentially their code...
Read more >AWS Lambda function errors in Node.js
This page describes how to view Lambda function invocation errors for the Node.js runtime using the Lambda console and the AWS CLI.
Read more >Lambdaでindex.handler is undefined or not exportedが出た時 ...
Copied! index.handler is undefined or not exported. 対処法. 以下の2つを実施した。
Read more >Lambda returning Runtime.HandlerNotFound error - not sure ...
HandlerNotFound: index.handler is undefined or not exported", " at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)", ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jingxizhang I upgraded to 4.18.1 and it fixed the problem. But I had to do one trick because when I just ran
amplify auth update
again hoping to just refresh my add to groups function, it didn’t fix the file structure. What I had to do is this:amplify auth update
amplify auth update
again and chose to create add to group function.Hope this helps.
Hi same here.
amplify function invoke <function>
givesIt seems that the lib is looking for
event.json
andindex.js
inside the src directoryEDIT:
If you move the files accordingly to the following
and alter the index.js function to your needs. For my use case it was like: