amplify-js: Auth SignUp auto send another request and throw Error: No credentials, applicationId or region

** Which Category is your question related to? ** Auth ** What AWS Services are you utilizing? ** Cognito ** Provide additional details e.g. code snippets ** 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:

message: “Unauthenticated access is not supported for this identity pool.” __type: “NotAuthorizedException”

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.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 21
  • Comments: 30 (5 by maintainers)

Most upvoted comments

Disabling as per the docs fixed this for me.

This is still an issue, disabling the analytics is not the right solution. Are there any status updates on this? Did anyone figure out what’s causing it

we are not using analytics, but updating all imports like the following [no aws-amplify] solved the issue …

import Amplify from '@aws-amplify/core';
import Auth from '@aws-amplify/auth';
import { Hub } from '@aws-amplify/core';

@filipemcg oh oh oh. Thanks for the tip! using only @aws-amplify/core @aws-amplify/auth fixed the problem!

Above solutions not worked for me

I am using aws-amplify and aws-amplify-react-native

The following solution is working for me. Have to manually disable Analytics when using with React Native:

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

I’m experiencing the same issue but I’m not using @aws-amplify/analytics.

Are you sure you have not imported the whole aws-amplify package?

@filipemcg oh oh oh. Thanks for the tip! using only @aws-amplify/core @aws-amplify/auth fixed the problem!

we are not using analytics, but updating all imports like the following [no aws-amplify] solved the issue …

import Amplify from '@aws-amplify/core';
import Auth from '@aws-amplify/auth';
import { Hub } from '@aws-amplify/core';

Run into same problem with new project

we are not using analytics, but updating all imports like the following [no aws-amplify] solved the issue …

import Amplify from '@aws-amplify/core';
import Auth from '@aws-amplify/auth';
import { Hub } from '@aws-amplify/core';

@filipemcg oh oh oh. Thanks for the tip! using only @aws-amplify/core @aws-amplify/auth fixed the problem!

Above solutions not worked for me

I am using aws-amplify and aws-amplify-react-native

I’m experiencing the same issue but I’m not using @aws-amplify/analytics.

I got it working by reverting @aws-amplify/analytics to 1.2.16.

"aws-amplify": "1.1.28",
"@aws-amplify/analytics": "1.2.16",

Can confirm that this works. Thanks!

I found the conditions that is causing the AWSPintpointProvider.ts error.

IF I import Analytics from ‘@aws-amplify/analytics’; even if I don’t use it at runtime ( in our project we call analytics.record only in production mode set by environment.prod.ts ) AND the JSON to Amplify.configure is missing the “Analytics” settings ( again we conditionally add the analytics json using Object.assign to add the analytics configs at runtime)

THEN the Uncaught exception will appear.

The exception start to appear today, an is likely because we upgraded to the latest amplify (stable) sometime this week.

versions details ( everything are the latest stable except TypeScript is at 3.4.5) “@aws-amplify/analytics”: “^1.2.17”, “@aws-amplify/api”: “^1.0.36”, “@aws-amplify/auth”: “^1.2.25”, “@aws-amplify/ui”: “^1.0.20”, “aws-amplify-angular”: “^3.0.4”,

Angular 8.0.3

In your configs:

{
  Auth: {
    identityPoolId: 'REGION_STR:xxxxxxxxxxxxxx', 
    region: 'REGION_STR',
  },
  Analytics: {
    AWSPinpoint: {
      // Amazon Pinpoint App Client ID
      appId: 'xxxxxxxxxxx',
      // Amazon service region
      region: 'us-east-1'
    }
  }
};
  • MAKE SURE THAT identityPoolId starts from i, NOT FROM I * (thanks for incorrect docs and examples)

#3614 should prevent “Error: No credentials, applicationId or region.” from occurring when Analytics is not be used or configured.

I got it working by reverting @aws-amplify/analytics to 1.2.16.

"aws-amplify": "1.1.28",
"@aws-amplify/analytics": "1.2.16",

I get the same error with react native after an update. aws-amplify@1.1.29 “react”: “16.8.3”, “react-native”: “0.59.9”,