首页 > 解决方案 > Amplify Auth SignUp auto send another request and throw Error: No credentials, applicationId or region

问题描述

I have 2 projects which are using the same code like this:

Auth.signUp({ username, password, attributes })
  .then(data => console.log(data))
  .catch(error => console.log(error))
  .finally(() => console.log('done'));

Just like this: https://aws-amplify.github.io/docs/js/authentication#sign-up

Here is the problem show out:

After that, I got the error in console: Error: No credentials, applicationId or region.

Not sure why is the old project is working fine but with this one, this error show up. Is it because the different in amplify ?

Thanks.

标签: aws-amplify

解决方案


从我对这个链接的理解来看,我认为问题出在 AWS 的分析包上。像这样禁用它对我有用

import config from './aws-exports';
Amplify.configure({
    ...config,
    Analytics: { 
      disabled: true
    }
});

推荐阅读