【问题标题】:AWS Amplify: How to setup { withConnector } component?AWS Amplify:如何设置 { withConnector } 组件?
【发布时间】:2018-09-01 06:40:09
【问题描述】:

Amplify Quick Start 之后,我使用awsmobile-cli 设置了一个AWS 移动应用程序:

awsmobile init
awsmobile user-signin enable
awsmobile push

在我的 react 应用程序中,我像这样配置了 Amplify(我也尝试了手动配置):

import Amplify from 'aws-amplify';
import aws_exports from '../../aws-exports.js';
Amplify.configure(aws_exports);
import { withAuthenticator } from 'aws-amplify-react';

...
export default withAuthenticator(App);

此代码向我显示 Cognito UI,但在任何操作中,我都会出现以下错误:

没有用户池

如何正确连接 Amplify withConnector 组件与我应用的 userPool?


附:昨天晚上我的应用程序运行完美。今天我只做了一些小改动,无法解释这种行为。

【问题讨论】:

    标签: amazon-web-services authentication aws-cognito aws-amplify aws-userpools


    【解决方案1】:

    您能否检查一下您的node_modules/aws-amplify-react/node_modules 下是否有aws-amplify。有时 npm 会安装两次并导致一些问题

    【讨论】:

    • 可能是问题所在。我删除了 npm 文件夹和我的 aws 移动应用程序,在进行新设置后,一切似乎都正常了。我想我会接受你的回答来关闭这个问题。
    猜你喜欢
    • 2020-08-30
    • 2023-04-03
    • 2020-07-25
    • 2020-03-27
    • 2020-08-10
    • 2022-01-05
    • 2023-02-24
    • 2020-12-22
    • 1970-01-01
    相关资源
    最近更新 更多