aws-samples / aws-samples/aws-lex-web-ui

postTextMessage TypeError: Cannot read properties of undefined

Open
#863 19 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
817
Forks
506
PR merge metrics
No merged PRs in 30d

Description

Hello Team,
I am using manual deployment without CF Template and used upload file feature.but when added the chatbot to sharepoint getting below error

actions: sendTypingEvent
lex-web-ui.min.js:142 Error: Resolved credential object is not valid
at Oe.validateResolvedCredentials (lex-web-ui.min.js:142:47174)
at Oe.signRequest (lex-web-ui.min.js:142:45741)
lex-web-ui.min.js:142 error in postTextMessage TypeError: Cannot read properties of undefined (reading 'sessionAttributes')
at lex-web-ui.min.js:142:387105

I have generated the cloudfront url using the old template((Master Lex Web UI CloudFormation template (v0.19.6)) and then deployed the new code to same buckets

[master.8.yaml](https://github.com/user-attachments/files/24933065/master.8.yaml)
[lexbot.1.yaml](https://github.com/user-attachments/files/24933064/lexbot.1.yaml)

[cognitouserpoolconfig.3.yaml](https://github.com/user-attachments/files/24933092/cognitouserpoolconfig.3.yaml)
[cognito.3.yaml](https://github.com/user-attachments/files/24933093/cognito.3.yaml)
[CodeBuild-Deploy.7.yaml](https://github.com/user-attachments/files/24933091/CodeBuild-Deploy.7.yaml)
++++++++++++++++++++++++++++++++++++++++++++++
Can I add the below code to my existing template to work the file upload feature
Parameter:
ShouldEnableUpload:
Type: String
Default: false
AllowedValues:
- true
- false
Description: >
If set to True, the upload document functionality will be available. The icon for uploading documents
will appear in the UI and an API Gateway endpoint will be deployed for generating pre-signed URLs for the UI
to utilize for uploading documents. By default, pre-signed URLs have a TTL of 60 seconds.

UploadBucket:
Type: String
Default: ''
Description: >
If enabling upload, the name of the S3 bucket where uploaded documents should be stored
parameters

ShouldEnableUpload
UploadBucket
ShouldEnableUpload: !Ref ShouldEnableUpload
UploadBucket: !Ref UploadBucket

ShouldEnableUpload: !Ref ShouldEnableUpload
UploadBucket: !Ref UploadBucket

Can i add above configuration to add upload feauture in my existing template

Contributor guide

Open the contributing guide

Research direction

Start by comparing the deployed lex-web-ui.min.js behavior with the attached master.8.yaml, lexbot.1.yaml, cognitouserpoolconfig.3.yaml, cognito.3.yaml, and CodeBuild-Deploy.7.yaml files, using the old Master Lex Web UI CloudFormation template v0.19.6 as context. Trace the credential error before postTextMessage and verify whether the ShouldEnableUpload and UploadBucket parameters are wired into the existing deployment. Done means the SharePoint chatbot can send messages and the upload feature works without either reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cloud, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.