Closed
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
Yesterday I updated my react-native app to version 0.72.0.
Since then I get issues that modules can't be resolved when I try to run the Android emulator.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
React Native
Details of the browser/Node.js/ReactNative version
0.72.0
Reproduction Steps
Reproduction steps
- Install react native & aws sdk:
npx react-native@latest init Project --template react-native-template-typescript
npm install @aws-sdk/client-cognito-identity-provider
- Add the following to the import section of to App.tsx:
import {
CognitoIdentityProviderClient,
InitiateAuthCommandInput,
InitiateAuthCommand,
AuthFlowType
} from "@aws-sdk/client-cognito-identity-provider";
const region = "us-east-1";
const cognitoClient = new CognitoIdentityProviderClient({
region,
});
- Add the following code to the App function:
const params: InitiateAuthCommandInput = {
ClientId: "clientId",
AuthFlow: AuthFlowType.USER_PASSWORD_AUTH,
AuthParameters: {
USERNAME: "username",
PASSWORD: "password",
},
};
const initiateAuthCommand = new InitiateAuthCommand(params);
cognitoClient.send(initiateAuthCommand)
- Then run the following commands:
npm start
npm run android
Observed Behavior
App does no longer launch. It gets the following error message:
Expected Behavior
App launches w/o error message.
Possible Solution
The simple solution seems to install the "stream" package. But then another module can't be loaded. Until it says it can't load the module "http". And then I didn't know what to do anymore.
Note that one month ago I didn't have any of those issues.
Additional Information/Context
Another user with a similar issue: #3549
Unfortunately he didn't say how he solved his issue.