本文介绍了AWS Amplify:如何设置{withConnector}组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

按照放大快速入门,我使用awsmobile-cli:

awsmobile init
awsmobile user-signin enable
awsmobile push

在我的react App中,我像这样配置Amplify(我也尝试过手动配置):

In my react App I configured Amplify like so (I also tried manual configuration):

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用户界面,但是在执行任何操作时,都会出现以下错误:

This Code shows me the Cognito UI, but on any action, I take the following error appears:

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

How do I properly connect the Amplify withConnector component with my App's userPool?

P.S.昨天晚上,我的应用程序正常运行.今天,我只做了一些小的更改,无法解释这种行为.

P.S. Yesterday evening my app was working flawlessly. Today I only performed some minor changes and cannot explain this behavior.

推荐答案

是否可以检查node_modules/aws-amplify-react/node_modules下是否存在aws-amplify.有时npm会安装两次,并导致一些问题

Can you check if there is aws-amplify under your node_modules/aws-amplify-react/node_modules. Sometimes npm will install it twice and caused some problem

这篇关于AWS Amplify:如何设置{withConnector}组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 17:20