* 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.
After trying and creating some new project, I notice that every new project got this issues:
Error: No credentials, applicationId or region
I thought there are some changes in Amplify JS ?
Run into same problem with new project
Same here. Starting to get this today from the ng e2e, which tests Auth signin workflow. ( I was fine just yesterday)
"ERROR" Error: Uncaught (in promise): Error: No credentials, applicationId or region
while deployed project is working fine. Very strange.
+1.
Everything seems to be working fine, but that message appears in console.
Here is what I found so far. ( in my case)
The Uncaught exception is from AWSPinpointProvider.ts ( line 155 record function: public async record(params, handlers: PromiseHandlers) { } )
As soon as I disabled Analytics in my project, it works fine without the error.
I agree the app may works fine for you, but it is not passing my ng e2e testing with that exception.
The fact that there is no code change in my project. I believe it is a change on AWS Pinpoint REST API, combined with obviously, uncaught exception, and caching of credential in my old projects.
@namnh06 Can you provide a copy of your package.json
, I want to verify which version you are experiencing this on. Even with creating a new project I would just like to see. Also, can you see about using the latest unstable version running npm install --save aws-amplify@unstable
or yarn add aws-amplify@unstable
depending on your build system you are using. Prior to installing the unstable version, see about doing a full removal of your node_modules
and any lock files you have e.g. yarn.lock
or package-lock.json
I get same error with aws-amplify@unstable. Also happens with Auth.signIn()
I have only Auth added to backend
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
My aws-exports.js file is
const awsmobile = {
"aws_project_region": "...",
"aws_cognito_identity_pool_id": "...",
"aws_cognito_region": "...",
"aws_user_pools_id": "...",
"aws_user_pools_web_client_id": "...",
"oauth": {}
};
export default awsmobile;
Should there be generated Auth: {}
?
I kind of remember that there used to be...
Also tried adding Auth with default configuration and custom configuration
@namnh06 Can you provide a copy of your
package.json
, I want to verify which version you are experiencing this on. Even with creating a new project I would just like to see. Also, can you see about using the latest unstable version runningnpm install --save aws-amplify@unstable
oryarn add aws-amplify@unstable
depending on your build system you are using. Prior to installing the unstable version, see about doing a full removal of yournode_modules
and any lock files you have e.g.yarn.lock
orpackage-lock.json
Hi @sammartinez ,
For your information:
"aws-amplify": "^1.1.29",
"aws-amplify-angular": "^3.0.4"
"aws-amplify": "^1.1.28",
"aws-amplify-angular": "^3.0.3"
for the whole package.json, you can look at it here: https://gist.github.com/namnh06/336b49acac9edefc4df152a6b3024c46
I tried to remove everything & install aws-amplify with the version like the old one but no luck.
Also, can you see about using the latest unstable version running npm install --save aws-amplify@unstable or yarn add aws-amplify@unstable depending on your build system you are using. Prior to installing the unstable version, see about doing a full removal of your node_modules and any lock files you have e.g. yarn.lock or package-lock.json
Tried it, no luck either.
I thought @gerrytsui was right and wrong, because of if API, so, the old project should be affect too, but there is not.
I get the same error with react native after an update.
[email protected]
"react": "16.8.3",
"react-native": "0.59.9",
I had posted a question regarding the same: https://stackoverflow.com/questions/56680112/bad-request-is-returned-when-amplify-is-configured-for-hosted-ui-in-angular-6
@arjunsk I got one from yesterday, but no luck till now : https://stackoverflow.com/questions/56659183/amplify-auth-signup-auto-send-another-request-and-throw-error-no-credentials-a
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 got it working by reverting
@aws-amplify/analytics
to1.2.16
."aws-amplify": "1.1.28", "@aws-amplify/analytics": "1.2.16",
Can confirm that this works. Thanks!
I'm experiencing the same issue but I'm not using @aws-amplify/analytics
.
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';
Disabling as per the docs fixed this for me.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.
Disabling as per the docs fixed this for me.
Thanks, this worked!
You can also suppress the warning if disabling analytics doesn't fix the issue:
YellowBox.ignoreWarnings(["No credentials, applicationId or region"]);
I am also facing this issue now.
Note: I am not using analytics anywhere while Auth.signIn and Auth.signUp
I am using the below versions.
"aws-amplify": "^2.2.5",
"aws-amplify-react-native": "^3.2.2",
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'
}
}
};
identityPoolId
starts from i
, NOT FROM I
* (thanks for incorrect docs and examples)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
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
}
});
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
Most helpful comment
Disabling as per the docs fixed this for me.