Uncaught Error: Both UserPoolId and ClientId are required

Uncaught Error: Both UserPoolId and ClientId are required

我正在研究在 vue js 应用程序中使用 cognito 进行登录验证,以下是我在 main.js 中添加的代码:

import Amplify from 'aws-amplify';
Amplify.configure({
      Auth: {
        mandatorySignIn: false,
        region: config.cognito.REGION,
        userPoolId: config.cognito.USER_POOL_ID,
        UserPoolClientId: config.cognito.APP_CLIENT_ID,
      },
    });

但不知何故我收到了这种错误:

CognitoUserPool.js?17a7:46 Uncaught Error: Both UserPoolId and ClientId are required.
    at new CognitoUserPool (CognitoUserPool.js?17a7:46)
    at AuthClass.configure (Auth.js?bf82:183)
    at eval (Amplify.js?7d03:83)
    at Array.map (<anonymous>)
    at AmplifyClass.configure (Amplify.js?7d03:82)
    at eval (main.js?56d7:15)
    at Module../src/main.js (app.js:1692)
    at __webpack_require__ (app.js:854)
    at fn (app.js:151)
    at Object.1 (app.js:2809)

我已经按照参考视频和 aws amplify 文档尝试了很多方法。但仍然出现同样的错误,我的页面因控制台错误而空白。 检查了 Auth 选项,一切正常。我该如何克服这个错误?我也没有使用任何客户端秘密哈希,因为 js sdk 不适用于带有秘密哈希的应用程序客户端

配置参数名称需要

...
userPoolId: '...'
userPoolWebClientId: '...'
...

定义如下:https://github.com/aws-amplify/amplify-js/blob/a047ce73abe98c3bf82e888c3afb4d2f911805f3/packages/auth/src/types/Auth.ts#L40