Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Lambda is not a constructor when setting up Lambda with Lex #8539

Closed
4 tasks done
psantora-amazon opened this issue Oct 25, 2021 · 2 comments · Fixed by #8544
Closed
4 tasks done

TypeError: Lambda is not a constructor when setting up Lambda with Lex #8539

psantora-amazon opened this issue Oct 25, 2021 · 2 comments · Fixed by #8544
Labels
bug Something isn't working functions Issues tied to the functions category interactions issues tied to the interactions category

Comments

@psantora-amazon
Copy link

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v15.12.0

Amplify CLI Version

6.3.1

What operating system are you using?

mac

Amplify Categories

function, interactions

Amplify Commands

add

Describe the bug

psantora@147dda2f836a frontend % amplify add interactions
⚠️ Amplify command hooks are disabled in the current execution environment.
⚠️ See https://docs.amplify.aws/cli/usage/command-hooks/ for more information.
Using service: Lex, provided by: awscloudformation

Welcome to the Amazon Lex chatbot wizard
You will be asked a series of questions to help determine how to best construct your chatbot.

? Provide a friendly resource name that will be used to label this category in the project: testAmplify
? Would you like to start with a sample chatbot or start from scratch? Start from scratch
? Enter a name for your bot: testPoAmplify
? Choose an output voice: Male
? After how long should the session timeout (in minutes)? 5
? Please indicate if your use of this bot is subject to the Children's Online Privacy Protection Act (COPPA).
Learn more: https://www.ftc.gov/tips-advice/business-center/guidance/complying-coppa-frequently-asked-questions No

First create an intent for your new chatbot. An intent represents an action that the user wants to perform.

? Give a unique name for the new intent: testIntent
? Enter a sample utterance (spoken or typed phrase that invokes your intent. e.g. Book a hotel) hi tell me about yourself
? Would you like to add another utterance? Yes
? Enter a sample utterance (spoken or typed phrase that invokes your intent. e.g. Book a hotel) hi what are you
? Would you like to add another utterance? Yes
? Enter a sample utterance (spoken or typed phrase that invokes your intent. e.g. Book a hotel) hi how do you work
? Would you like to add another utterance? No

Now, add a slot to your intent. A slot is data the user must provide to fulfill the intent.

? Enter a name for your slot (e.g. Location) NAME
? Would you like to choose an Amazon built-in slot type, a slot type you've already made, or create a new slot type? Amazon built-in slot type
? Choose a slot type: AMAZON.Person
? Enter a prompt for your slot (e.g. What city?) Can you please tell me your name?
? Should this slot be required? No
? Would you like to add another slot? No
? Would you like to add a confirmation prompt to your intent? No
? How would you like the intent to be fulfilled? AWS Lambda Function
TypeError: Lambda is not a constructor
at Object.getLambdaFunctions (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utility-functions.js:160:31)
at AmplifyToolkit.executeProviderUtils [as _executeProviderUtils] (/usr/local/lib/node_modules/@aws-amplify/cli/src/extensions/amplify-helpers/execute-provider-utils.ts:7:46)
at askLambda (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/provider-utils/awscloudformation/service-walkthroughs/lex-walkthrough.js:699:49)
at addIntent (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/provider-utils/awscloudformation/service-walkthroughs/lex-walkthrough.js:430:20)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at configure (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/provider-utils/awscloudformation/service-walkthroughs/lex-walkthrough.js:299:20)
at Object.executeAmplifyCommand (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/index.js:70:3)
at executePluginModuleCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:178:3)
at Object.executeCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:30:5)
at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/src/index.ts:205:5)
There was an error adding the interactions resource

Expected behavior

Amplify should allow me to create/assign a Lambda to Lex through the interactions command

Reproduction steps

psantora@147dda2f836a frontend % amplify add interactions
⚠️ Amplify command hooks are disabled in the current execution environment.
⚠️ See https://docs.amplify.aws/cli/usage/command-hooks/ for more information.
Using service: Lex, provided by: awscloudformation

Welcome to the Amazon Lex chatbot wizard
You will be asked a series of questions to help determine how to best construct your chatbot.

? Provide a friendly resource name that will be used to label this category in the project: testAmplify
? Would you like to start with a sample chatbot or start from scratch? Start from scratch
? Enter a name for your bot: testPoAmplify
? Choose an output voice: Male
? After how long should the session timeout (in minutes)? 5
? Please indicate if your use of this bot is subject to the Children's Online Privacy Protection Act (COPPA).
Learn more: https://www.ftc.gov/tips-advice/business-center/guidance/complying-coppa-frequently-asked-questions No

First create an intent for your new chatbot. An intent represents an action that the user wants to perform.

? Give a unique name for the new intent: testIntent
? Enter a sample utterance (spoken or typed phrase that invokes your intent. e.g. Book a hotel) hi tell me about yourself
? Would you like to add another utterance? Yes
? Enter a sample utterance (spoken or typed phrase that invokes your intent. e.g. Book a hotel) hi what are you
? Would you like to add another utterance? Yes
? Enter a sample utterance (spoken or typed phrase that invokes your intent. e.g. Book a hotel) hi how do you work
? Would you like to add another utterance? No

Now, add a slot to your intent. A slot is data the user must provide to fulfill the intent.

? Enter a name for your slot (e.g. Location) NAME
? Would you like to choose an Amazon built-in slot type, a slot type you've already made, or create a new slot type? Amazon built-in slot type
? Choose a slot type: AMAZON.Person
? Enter a prompt for your slot (e.g. What city?) Can you please tell me your name?
? Should this slot be required? No
? Would you like to add another slot? No
? Would you like to add a confirmation prompt to your intent? No
? How would you like the intent to be fulfilled? AWS Lambda Function
TypeError: Lambda is not a constructor
at Object.getLambdaFunctions (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utility-functions.js:160:31)
at AmplifyToolkit.executeProviderUtils [as _executeProviderUtils] (/usr/local/lib/node_modules/@aws-amplify/cli/src/extensions/amplify-helpers/execute-provider-utils.ts:7:46)
at askLambda (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/provider-utils/awscloudformation/service-walkthroughs/lex-walkthrough.js:699:49)
at addIntent (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/provider-utils/awscloudformation/service-walkthroughs/lex-walkthrough.js:430:20)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at configure (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/provider-utils/awscloudformation/service-walkthroughs/lex-walkthrough.js:299:20)
at Object.executeAmplifyCommand (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-interactions/index.js:70:3)
at executePluginModuleCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:178:3)
at Object.executeCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:30:5)
at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/src/index.ts:205:5)
There was an error adding the interactions resource

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line


Additional information

No response

@cjihrig
Copy link
Contributor

cjihrig commented Oct 25, 2021

Thanks for reporting this. I've opened #8544 to fix the issue.

@cjihrig cjihrig added functions Issues tied to the functions category interactions issues tied to the interactions category bug Something isn't working labels Oct 25, 2021
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working functions Issues tied to the functions category interactions issues tied to the interactions category
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants