- Newest
- Most votes
- Most comments
It looks like the error you're getting is related to the AWS SDK for JavaScript. The error message "t is not a constructor" suggests that there might be an issue with the way the SDK is being imported or used in your code.
One possible solution to this error is to try updating the version of the AWS SDK for JavaScript that you're using in your project. It's possible that the version you're currently using is not compatible with the version of Vite React or other dependencies you have installed. You might want to try using a different version of the SDK and see if that resolves the issue.
Another possible solution is to check if the SDK is being imported correctly in your code. Make sure that you're importing the SDK as a constructor and not as a plain object. For example, instead of importing it like this:
import AWS from 'aws-sdk';
Try importing it like this:
import { CognitoIdentityServiceProvider } from 'aws-sdk';
If neither of these solutions work, it might be helpful to provide more information about your code and how you're using the AWS SDK for JavaScript, so that we can better understand the issue and provide more specific advice.
Ran into a similar error with a Vite Vue 3 application. I was able to fix the issue upgrading to v3 of the aws-sdk. This required a few minor changes to how I was authenticating users, I would recommend this page : https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cognito-identity-provider/index.html
Relevant content
- asked 3 months ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago