-
Notifications
You must be signed in to change notification settings - Fork 1
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
import_aws_cognito_srp_client.default is not a constructor... #2
Comments
But considering this gets compiled in my dev environment, I would think it should Just Work in Lambda. Very stumped. |
I've submitted a pull request, but I'm still experiencing problems. Namely, when I use this in my dev environment with the modifications I've submitted in my pull request, the polyfill fails to find a native crypto. The reason for this is best explained here: https://codedamn.com/news/javascript/fix-require-is-not-defined Note where it states:
So I tried modifying the cryptoUtils.ts code to have the following at the top:
Then, within the polyFillCrypto function, I placed the following:
But then, what is the point of the polyfill? Is it possible to remove polyFillCrypto and the
I don't quite know enough about what this area of the code is intending to know if this is the most correct way to handle this. I'm also not familiar enough with TS/JS to know if any of this is quite right. |
I would like to know more on how you deploy code to lambda ? are you using any frameworks or manually copying ? |
For this code, I'm using sveltekit-adapter-aws. |
Following README.md directly with:
When I run this in my dev environment, everything works very well. Very pleased with it.
When I run this within a lambda function in AWS, an exception is thrown reading:
I don't know if it's helpful, but lambda runs nodejs v16.12. My dev environment run v16.19.0. I have not tried changing the dev environment to an earlier version of nodejs to see if that's the difference.
The text was updated successfully, but these errors were encountered: