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 - Cannot read properties of undefined (reading 'querystring') #84

Open
prachimore1406 opened this issue Jan 15, 2024 · 0 comments

Comments

@prachimore1406
Copy link

I'm facing this error while testing the Lambda@edge function with a CF distribution:

=====================================================================
From the Lambda logs -

Response
{
"errorType": "TypeError",
"errorMessage": "Cannot read properties of undefined (reading 'querystring')",
"trace": [
"TypeError: Cannot read properties of undefined (reading 'querystring')",
" at Authenticator.handle (/var/task/node_modules/cognito-at-edge/dist/index.js:511:64)",
" at Runtime.exports.handler (/var/task/index.js:11:52)",
" at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1173:29)"
]
}

503 ERROR
The request could not be satisfied.
The Lambda function associated with the CloudFront distribution is invalid or doesn't have the required permissions. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.

Lambda function:

const { Authenticator } = require('cognito-at-edge');

const authenticator = new Authenticator({
// Replace these parameter values with those of your own environment
region: 'us-east-1', // user pool region
userPoolId: 'xxx', // user pool ID
userPoolAppId: 'xxxx', // user pool app client ID
userPoolDomain: 'xxxx', // user pool domain
});

exports.handler = async (request) => authenticator.handle(request);
Can someone assist in addressing this please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant