New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: No credentials, applicationId or region #5918
Comments
@nihp My fix was for just this issue which is the error coming from We will have someone from the team to look at this. In any case, sample code to reproduce the issue will help the team resolve your issue faster. Could you provide us with sample code and how your aws-exports (removing sensitive info) look like.? |
I do want to callout that we do have others on the team that review besides @ashika01. While it's alright to tag people in order to look at issues, it's not recommended as people can be on vacation at times or out of the office. We do take in issues as a first come and first serve approach as well so it may take some time for us to get back to you on issues. As stated above, we can have someone look into this but can you provide us a sample code of what you're experiencing in order to help you further? Thanks ahead of time. |
For me it happening before as well as after upgrading the latest version too.
|
@nihp Are you installing the |
In the latest update of aws-amplify, they removed aws-sdk dependency and we need to install separately according to this doc. So here I have used aws-amplify, aws-amplify-react-native and aws-sdk v2. Update of amplify 3..x.x:
AWS.credentials and AWS.config don’t exist anymore anywhere in Amplify JS aws-sdk@2.x has been removed from Amplify@3.x.x in favor of version 3 of aws-sdk-js. We recommend to migrate to aws-sdk-js-v3 if you rely on AWS services that are not supported by, Amplify, since aws-sdk-js-v3 is imported modularly.
If you have any updates let me know |
I had the same issue (running on the latest Amplify v3) and worked around it by changing the following: Amplify.configure({
...config,
Analytics: {
disabled: true,
},
}); The strange thing is that I'm not using Analytics at all, but apparently the error is gone. |
This fixed my error, thanks! |
@joostfarla Your solution worked for me. Thanks |
Can anyone explain what is the root cause of the error? And after adding the Analytics: false it worked. |
And what to do if you use Analytics?? (which is my case) |
@witalobenicio Ideally you shouldn't see the error if use analytics.. If you do see it then, then there is something you are missing while configuring Analytics |
Again I am facing the same error. After adding analytics true it worked and after two days we again faced the same error. Now I didn't have any solution for this. Still facing the same issue. |
@ashika01 This error happens if I use The problem is that this package is a waaaay huge to just use it for analytics. Can we have a solution? |
We are facing the same issue, but it does not happen consistently. After inspecting our error tracking tool the call to get the credentials on amplify-js/packages/core/src/Credentials.ts Line 102 in 3642e6a
|
I had the same problem and was stuck - nothing above worked... until I actually uninstalled the @aws-amplify/analytics and @aws-amplify/auth packages. Even though I wasn't importing either of them their presence was enough to cause the error, it seems. |
If you still have this problem (I did with aws-amplify@latest), I added the code to my |
For me, it appears that the Amplify.configure({
Auth: {
// mandatorySignIn: true,
region: cognito.REGION,
userPoolId: cognito.USER_POOL_ID,
identityPoolId: cognito.IDENTITY_POOL_ID,
userPoolWebClientId: cognito.APP_CLIENT_ID,
},
aws_appsync_graphqlEndpoint,
aws_appsync_region,
aws_appsync_authenticationType,
}) |
Hey all, I am having this same issue and I have tried everything from all threads to get this working but I cannot. I have an existing project that has been running for many months using Amplify for API calls and user authentication, we are looking to move away from GA to Pinpoint for Web Analytics and in doing so have introduced analytics into our codebase. I get the following error:
Here is my code:
I have tried all of the recommended fixes like checking for a capital Any help I can get would be greatly appreciated. |
Hey guys, But I hava a working prototype for Analytics now and thought I'd share my findings.
This works for me (main/index/...): import Amplify from '@aws-amplify/core';
import Analytics from '@aws-amplify/analytics';
import Auth from '@aws-amplify/auth';
import awsconfig from './aws-exports';
Amplify.configure(awsconfig);
Auth.configure({ mandatorySignIn: false});
Analytics.record({ name: 'bootup' }); Where the final nail was the: Auth.configure({ mandatorySignIn: false}); Dependencies that works turned out to be: "dependencies": {
"aws-amplify": "^3.3.9"
} I cannot be bothered to try out all the other permutations of packages @aws-amplify/core, analytics, auth etc. |
If your auth type is API key then also check its validity from AWS console -> AWS AppSync -> chooses your API -> Settings -> scroll down to Default authorization mode -> check that it has not expired there. |
I was just doing the basic walkthrough and selected the option of 'guests or unauthorized users' when adding the analytics. Auth.configure({ mandatorySignIn: false}); oh, and here is my version
But I'll keep that in mind going forward |
So I managed to resolve the issue for me. Instead of doing this
I now do this As I said in my comment before I had tried this in the past. The difference this time is I actually uninstalled anything related to While this is a fix, it's not a fix I am particularly happy with, I now have to import the entire amplify package to have this working rather than individual packages. I'm also not really sure why there is a difference between |
No. its not expired but throwing up error - > GraphQLAPI - ensure credentials error No Cognito Identity pool provided for unauthenticated access
|
Thank you for this feedback @lukehillonline. As of now, this is what we recommend in order to solve your issue. I apologize this is not ideal but we believe the issue is with regards to how dependencies are being referenced when installing individual packages, which leads to triggering this error. You do have the ability to pin specific versions of each package if you would like to, however when a production build is done, any modules that are not in use will be tree shaken out. |
With help from the Amplify team, I fixed this issue by rolling back to these specific module versions, clearing yarn cache, cleaning the build, deleting node_modules, and
|
This worked for me, thanks! |
Resolving as the above statement is the solution |
Got the issue with latest version. Is there any fresh solution? Fresher than 11 Dec 2020? |
After
it works again |
Hello, is this still applicable with 4.0.x ? (we are on 4.0.3) We are trying to iron out the errors at startup in a react-native application and we have both the require cycle coming from the 'aws-amplify' import as well as this issue. Both having a solution/workaround incompatible with each other.
|
If you don't use Analytics disable it like this. Acording to the docs. Solved for me. |
For those of us who NEED Analytics: Background: I was trying to use this in an Expo React-Native app, but I was getting this error when associating a token with a user ( I installed Turn out this looks like a version mismatch, because this actually worked out for me:
|
How are we supposed to know this? Where is it documented? |
Hello, I have been having this issue for quite a while, followed as far as I know all the threads that offer solutions. On some versions of Amplify I get the "Error: No credentials, applicationId or region", on others it is an issue with Pinpoint and maximum number being exceeded (we am using analytics, so the disable analytics solution is a non-solution). These all happen when using Amplify version 3.x.x. When I try to update to 4 or 5, these issues seemingly disappear, however then the whole application just crushes on the Amplify.configure (this only happens in production mode also, so very frustrating to debug) Is there anybody who does use Analytics in their Expo app and has been able to solve this issue? I am getting quite desperate with this now. I can provide my package.json, but for now I left it out as I already tried multiple versions, combinations of versions and packages to try to solve this issue without any success. |
I am having same issue while log analytics events,
Using following dependancies,
using s3,
|
I'm having this issue consistently. Downgrading I think it's working OK, but the logs are very irritating and make debugging a chore. |
@julian-kingman-lark and @dinesh-brilworks (or anyone else on this issue), are you still experiencing this in the latest versions of Amplify v.5X? Or can anyone confirm if they still experience this issue after upgrading to v6 (latest major version) using the v6 API's? |
@cwomack Unfortunately, I am. I have not had time to upgrade from 5x to 6x (that's not entirely true, I have that incomplete effort in a separate branch), but needed to turn on Analytics this week. I am getting the same error as the rest and am hunting for the answer. If you have any workaround for the 5x version I'd love to hear it. |
Error: No credentials, applicationId or region with the latest aws-amplify ad aws-amplify-react-native version.
Auth.signIn succeeds but throws console error and every time it showing the warning
#5629 fix not working in the latest version.
@ashika01 Can you let me know if you have any updates or whether I need to change anything from my side
The text was updated successfully, but these errors were encountered: