amplify-js: Error: No credentials, applicationId or region
Error: No credentials, applicationId or region with the latest aws-amplify ad aws-amplify-react-native version.
"aws-amplify": "^3.0.11",
"aws-amplify-react-native": "^4.1.2",
"aws-sdk": "^2.681.0",
Auth.signIn succeeds but throws console error and every time it showing the warning
https://github.com/aws-amplify/amplify-js/pull/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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 45 (9 by maintainers)
I had the same issue (running on the latest Amplify v3) and worked around it by changing the following:
The strange thing is that I’m not using Analytics at all, but apparently the error is gone.
And what to do if you use Analytics?? (which is my case)
This fixed my error, thanks!
@joostfarla Your solution worked for me. Thanks
So I managed to resolve the issue for me. Instead of doing this
I now do this
import { API, Auth, Analytics } from 'aws-amplify';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
@aws-amplify. If both@aws-amplifyandaws-amplifyare in yournode_modulesthen the issue will persist.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
@aws-amplifyandaws-amplify.How are we supposed to know this? Where is it documented?
If you don’t use Analytics disable it like this. Acording to the docs. Solved for me.
Amplify.configure({ ...config, Analytics: { disabled: true, } });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
yarn installeverything fresh. I no longer get this error.Hey guys, I’ve been fighting Amplify for several days now and I must say I am not impressed with its documentation… it really makes me question the wisdom of going this route - I’m sorry to say.
But I hava a working prototype for Analytics now and thought I’d share my findings. The error I was seeing was:
This works for me (main/index/…):
Where the final nail was the:
Dependencies that works turned out to be:
I cannot be bothered to try out all the other permutations of packages @aws-amplify/core, analytics, auth etc. I hope this works for you too.
Can anyone explain what is the root cause of the error? And after adding the Analytics: false it worked.
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 (
Analytics.updateEndpoint({ ... })) and using@aws-amplify/xxx.I installed
aws-amplifyand everything worked fine. So I opened the yarn.lock to see the dependencies versions of the main package.Turn out this looks like a version mismatch, because this actually worked out for me:
Resolving as the above statement is the solution
The only thing that worked for me when I had this issue was removing the “@aws-amplify” imports and getting everything from the ‘aws-amplify’. Even after I switched my references just the mere presence of the “@” ones caused the error. I would try uninstalling those and see if the issue still persists. good luck!
On Fri, Oct 9, 2020 at 5:47 AM ltaljaard notifications@github.com wrote:
– Stefan Johnson CTO
(415) 260-8101 w http://www.outcrowdgroup.com/ww.outspoke.io [image: LinkedIn icon] https://www.linkedin.com/company/35475096 [image: Twitter icon] https://twitter.com/outspoke_io [image: Instagram icon] https://www.instagram.com/outspoke.io Check out our new podcast series I’m with RJ! https://im-with-rj.buzzsprout.com/
*All information contained herein is protected by express or implied confidentiality. * If you received this transmission in error, please delete and do not open or view any attached materials.
@ashika01 This error happens if I use
@aws-amplify/analyticsand@aws-amplify/core. When I use justimport Amplify from 'aws-amplify';it works.The problem is that this package is a waaaay huge to just use it for analytics.
Can we have a solution?