I am creating a sign-up page with React, node.js and AWS cognito. When handling the signup event I get the error 'aws_amplify__WEBPACK_IMPORTED_MODULE_2___default.a.signUp is not a function'
import Auth from "aws-amplify";
handleConfirmationSubmit = async event => {
event.preventDefault();
this.setState({ isLoading: true });
try {
await Auth.confirmSignUp(this.state.email, this.state.confirmationCode);
await Auth.signIn(this.state.email, this.state.password);
this.props.userHasAuthenticated(true);
this.props.history.push("/");
} catch (e) {
alert(e.message);
this.setState({ isLoading: false });
}
}
An ideas on how resolve this error?
I just changed from import API from "aws-amplify"; To import { API } from "aws-amplify";
Change import Auth from "aws-amplify"; to import Auth from "@aws-amplify/auth";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With