aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

Error: No credentials, applicationId or region #5918

Closed nihp closed 3 years ago

nihp commented 4 years ago

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

ashika01 commented 4 years ago

@nihp My fix was for just this issue which is the error coming from AWSPinpointProvider.js. Looking at the screenshot of error log on the PR referenced above. It unclear to me where this is 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.?

sammartinez commented 4 years ago

@nihp,

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.

nihp commented 4 years ago

For me it happening before as well as after upgrading the latest version too.

//aws-exports.js

const awsmobile = {
    "aws_project_region": "xxxxx",
    "aws_cognito_identity_pool_id": "xxxxxx",
    "aws_cognito_region": "xxxxxx",
    "aws_user_pools_id": "xxxxxx",
    "aws_user_pools_web_client_id": "xxxxxx",
    "oauth": {},
    "aws_user_files_s3_bucket": "xxxxxx",
    "aws_user_files_s3_bucket_region": "xxxxxx"
}

export default awsmobile;
sammartinez commented 4 years ago

@nihp Are you installing the aws-sdk package as well as the aws-amplify package? We do have a dependency on aws-sdk that we install for you. Please let us know

nihp commented 4 years ago

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:

Amplify@3.x.x has breaking changes. Please see the breaking changes below:

AWS.credentials and AWS.config don’t exist anymore anywhere in Amplify JS Both options will not be available to use in version 3. You will not be able to use and set your own credentials. Migration plan on “How to migrate to using Amplify provided credentials” will follow in the coming weeks after GA launch.

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 can't migrate to aws-sdk-js-v3 or rely on aws-sdk@2.x, you will need to import it separately.

We do have a dependency on aws-sdk that we install for you.

If you have any updates let me know

joostfarla commented 4 years ago

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.

macrouch commented 4 years ago

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!

nihp commented 4 years ago

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.

@joostfarla Your solution worked for me. Thanks

nihp commented 4 years ago

Can anyone explain what is the root cause of the error? And after adding the Analytics: false it worked.

witalobenicio commented 4 years ago

And what to do if you use Analytics?? (which is my case)

ashika01 commented 4 years ago

@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

nihp commented 4 years ago

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.

witalobenicio commented 4 years ago

@ashika01 This error happens if I use @aws-amplify/analytics and @aws-amplify/core. When I use just import 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?

rubene commented 4 years ago

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 https://github.com/aws-amplify/amplify-js/blob/3642e6af455ee1848c1cc743a7a503e96baefa41/packages/core/src/Credentials.ts#L102 seems to be getting a 400 response from Cognito

outspokeio commented 3 years ago

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.

sammartinez commented 3 years ago

@nihp We did do some fixes recently that resolve this issue, can you please test the latest version of aws-amplify and see if your issue is still present.

ltaljaard commented 3 years ago

@sammartinez I have run npm update aws-amplify but the error persists. Here is my package.json - is the anything else i need to update as well?

{ "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "eject": "expo eject", "amplify-modelgen": "node amplify/scripts/amplify-modelgen.js", "amplify-push": "node amplify/scripts/amplify-push.js" }, "dependencies": { "@aws-amplify/core": "^3.4.0", "@aws-amplify/datastore": "^2.2.4", "@expo/vector-icons": "^10.0.0", "@react-native-community/masked-view": "0.1.6", "@react-native-community/netinfo": "5.5.1", "@react-navigation/drawer": "^5.8.2", "@react-navigation/material-bottom-tabs": "^5.2.10", "@react-navigation/native": "^5.5.1", "@react-navigation/stack": "^5.5.1", "aws-amplify": "^3.3.3", "aws-amplify-react-native": "^4.2.1", "aws-sdk": "^2.770.0", "expo": "~37.0.3", "moment": "^2.27.0", "react": "~16.9.0", "react-dom": "~16.9.0", "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz", "react-native-action-button": "^2.8.5", "react-native-elements": "^2.0.2", "react-native-gesture-handler": "~1.6.0", "react-native-paper": "^3.10.1", "react-native-reanimated": "~1.7.0", "react-native-safe-area-context": "0.7.3", "react-native-screens": "~2.2.0", "react-native-web": "~0.11.7" }, "devDependencies": { "@babel/core": "^7.8.6", "babel-preset-expo": "~8.1.0", "ini": "^1.3.5", "inquirer": "^6.5.1" }, "private": true }

outspokeio commented 3 years ago

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:

@sammartinez https://github.com/sammartinez I have run npm update aws-amplify but the error persists. Here is my package.json - is the anything else i need to update as well?

{ "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "eject": "expo eject", "amplify-modelgen": "node amplify/scripts/amplify-modelgen.js", "amplify-push": "node amplify/scripts/amplify-push.js" }, "dependencies": { "@aws-amplify/core": "^3.4.0", "@aws-amplify/datastore": "^2.2.4", "@expo/vector-icons": "^10.0.0", "@react-native-community/masked-view": "0.1.6", "@react-native-community/netinfo": "5.5.1", "@react-navigation/drawer": "^5.8.2", "@react-navigation/material-bottom-tabs": "^5.2.10", "@react-navigation/native": "^5.5.1", "@react-navigation/stack": "^5.5.1", "aws-amplify": "^3.3.3", "aws-amplify-react-native": "^4.2.1", "aws-sdk": "^2.770.0", "expo": "~37.0.3", "moment": "^2.27.0", "react": "~16.9.0", "react-dom": "~16.9.0", "react-native": " https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz", "react-native-action-button": "^2.8.5", "react-native-elements": "^2.0.2", "react-native-gesture-handler": "~1.6.0", "react-native-paper": "^3.10.1", "react-native-reanimated": "~1.7.0", "react-native-safe-area-context": "0.7.3", "react-native-screens": "~2.2.0", "react-native-web": "~0.11.7" }, "devDependencies": { "@babel/core": "^7.8.6", "babel-preset-expo": "~8.1.0", "ini": "^1.3.5", "inquirer": "^6.5.1" }, "private": true }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aws-amplify/amplify-js/issues/5918#issuecomment-706160410, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKF57L5UNN3A2SZHVBPKQM3SJ4A6ZANCNFSM4NMCCB3Q .

-- 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.

ltaljaard commented 3 years ago

@outspokeio i have uninstalled @aws-amplify/code but the other @amplify one, @aws-amplify/datastore, is required by my app. Removing @aws-amplify/datastore. Any other ideas?

outspokeio commented 3 years ago

Import datastore from 'aws-amplify' and not @aws-amplify - i.e. "import { DataStore } from 'aws-amplify'.

On Fri, Oct 9, 2020 at 7:23 AM ltaljaard notifications@github.com wrote:

@outspokeio https://github.com/outspokeio i have uninstalled @aws-amplify/code but the other @amplify https://github.com/amplify one, @aws-amplify/datastore, is required by my app. Removing @aws-amplify/datastore. Any other ideas?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-amplify/amplify-js/issues/5918#issuecomment-706211926, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKF57L2BXEVR4XUCU4I4ZCTSJ4MGNANCNFSM4NMCCB3Q .

-- 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.

ltaljaard commented 3 years ago

@outspokeio That seems to move things along in the right direction and the app is getting further than before upon startup, but with the command "npm run amplify-modelgen" it creates a file in src/models/index.js and in there it does an "import { initSchema } from '@aws-amplify/datastore';" ... It doesn't work to manually change that one to "import { initSchema } from 'aws-amplify/datastore';" or such - it seems like initSchema is only present in '@aws-amplify' and not in 'aws-amplify' . Any advice to get around this?

outspokeio commented 3 years ago

Sorry to say you're now in areas of the pool where I have not swam. I just did a quick check to see if I could find anything on initSchema - pretty under-documented from what I am looking at. Perhaps try DataStore.initSchema?

On Fri, Oct 9, 2020 at 9:14 AM ltaljaard notifications@github.com wrote:

@outspokeio https://github.com/outspokeio That seems to move things along in the right direction and the app is getting further than before upon startup, but with the command "npm run amplify-modelgen" it creates a file in src/models/index.js and in there it does an "import { initSchema } from '@aws-amplify/datastore';" ... It doesn't work to manually change that one to "import { initSchema } from 'aws-amplify/datastore';" or such - it seems like initSchema is only present in '@aws-amplify https://github.com/aws-amplify' and not in 'aws-amplify' . Any advice to get around this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws-amplify/amplify-js/issues/5918#issuecomment-706272055, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKF57L5B2KN66IGHFNFCWDLSJ4ZHDANCNFSM4NMCCB3Q .

-- 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.

mateomorrison commented 3 years ago

If you still have this problem (I did with aws-amplify@latest), I added the code to my solutions repo. Also rm -rf node_modules and then npm i or yarn. This should clear it.

DavidWells commented 3 years ago

For me, it appears that the mandatorySignIn option set to true was causing this issue. Removed it and the No credentials, applicationId or region went away

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,
})
lukehillonline commented 3 years ago

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:

Error: No credentials, applicationId or region
    at AWSPinpointProvider.<anonymous> (AWSPinpointProvider.js:174)
    at step (AWSPinpointProvider.js:55)
    at Object.next (AWSPinpointProvider.js:36)
    at fulfilled (AWSPinpointProvider.js:27)

Here is my code:

    "@aws-amplify/analytics": "^3.3.11",
    "@aws-amplify/api": "^3.2.11",
    "@aws-amplify/auth": "^3.4.11",
import API from '@aws-amplify/api';
import Auth from '@aws-amplify/auth';
import Analytics from '@aws-amplify/analytics';

API.configure({
  endpoints: [
    {
      name: xxxx,
      endpoint: xxxx,
    },
  ],
});

Auth.configure({
  identityPoolId: xxxx,
  region: xxxx,
  userPoolId: xxxx,
  userPoolWebClientId: xxxx,
});

Analytics.configure({
  disabled: false,
  autoSessionRecord: true,
  AWSPinpoint: {
    appId: xxxx',
    region: xxxx,
    mandatorySignIn: false,
  },
});

export default function MyApp({ Component, pageProps }) {
  //Record an event
  const track = async () => {
    try {
      await Analytics.record({ name: 'test-event' });
    } catch (e) {
      console.log(e);
    }
  };

  useEffect(() => {
    track();
  }, []);

  return (
    <App>
      <Component {...pageProps} />}
    </App>
  );
}

I have tried all of the recommended fixes like checking for a capital I on identityPoolId or changing the import from @aws-amplify to aws-amplify or importing them all through { API, Auth, Analytics } from 'aws-amplify and so on but nothing has resolved it for me.

Any help I can get would be greatly appreciated.

icecog commented 3 years ago

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:

Uncaught (in promise) Error: No credentials, applicationId or region

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. I hope this works for you too.

ltaljaard commented 3 years ago

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.

icecog commented 3 years ago

I was just doing the basic walkthrough and selected the option of 'guests or unauthorized users' when adding the analytics. That should probably set some flag somewhere in the project to avoid me having to specify the mandatorySignIn setting in Auth

Auth.configure({ mandatorySignIn: false});

oh, and here is my version

amplify version 4.32.1

But I'll keep that in mind going forward

lukehillonline commented 3 years ago

So I managed to resolve the issue for me. Instead of doing this

import API from '@aws-amplify/api';
import Auth from '@aws-amplify/auth';
import Analytics from '@aws-amplify/analytics';

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-amplify and aws-amplify are in your node_modules then 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-amplify and aws-amplify.

anujmv commented 3 years ago

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.

No. its not expired but throwing up error - >

GraphQLAPI - ensure credentials error No Cognito Identity pool provided for unauthenticated access

Build error occurred Error: No credentials

sammartinez commented 3 years ago

So I managed to resolve the issue for me. Instead of doing this

import API from '@aws-amplify/api';
import Auth from '@aws-amplify/auth';
import Analytics from '@aws-amplify/analytics';

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-amplify and aws-amplify are in your node_modules then 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-amplify and aws-amplify.

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.

joebernard commented 3 years ago

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 install everything fresh. I no longer get this error.

"@aws-amplify/analytics": "3.3.11",
"@aws-amplify/auth": "3.4.11",
"@aws-amplify/cache": "3.1.36",
"@aws-amplify/core": "3.8.3",
"@aws-amplify/storage": "3.3.11",
"amazon-cognito-identity-js": "4.5.4",
AbirAbbas commented 3 years ago

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 install everything fresh. I no longer get this error.

"@aws-amplify/analytics": "3.3.11",
"@aws-amplify/auth": "3.4.11",
"@aws-amplify/cache": "3.1.36",
"@aws-amplify/core": "3.8.3",
"@aws-amplify/storage": "3.3.11",
"amazon-cognito-identity-js": "4.5.4",

This worked for me, thanks!

sammartinez commented 3 years ago

Resolving as the above statement is the solution

ahtokca commented 3 years ago

Got the issue with latest version. Is there any fresh solution? Fresher than 11 Dec 2020?

ahtokca commented 3 years ago

After

npm uninstall \
  aws-amplify \
  aws-amplify-react \
  aws-amplify-react-native \
  aws-appsync aws-sdk \
  "@aws-amplify/analytics" \
  "@aws-amplify/api" \
  "@aws-amplify/auth" \
  "@aws-amplify/core" \
  "@aws-amplify/pushnotification" \
  "@aws-amplify/storage"

npm install --save \
  aws-amplify \
  aws-amplify-react \
  aws-amplify-react-native \
  aws-appsync aws-sdk \
  "@aws-amplify/analytics" \
  "@aws-amplify/api" \
  "@aws-amplify/auth" \
  "@aws-amplify/core" \
  "@aws-amplify/pushnotification" \
  "@aws-amplify/storage"

it works again

plus- commented 3 years ago

So I managed to resolve the issue for me. Instead of doing this

import API from '@aws-amplify/api';
import Auth from '@aws-amplify/auth';
import Analytics from '@aws-amplify/analytics';

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-amplify and aws-amplify are in your node_modules then 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-amplify and aws-amplify.

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.

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.

Require cycle: ../../node_modules/@aws-amplify/pubsub/lib-esm/index.js -> ../../node_modules/@aws-amplify/pubsub/lib-esm/PubSub.js -> ../../node_modules/@aws-amplify/pubsub/lib-esm/Providers/index.js -> ../../node_modules/@aws-amplify/pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider.js -> ../../node_modules/@aws-amplify/pubsub/lib-esm/index.js

WARN Possible Unhandled Promise Rejection (id: 0): Error: No credentials, applicationId or region

kornatskyi commented 3 years ago

If you don't use Analytics disable it like this. Acording to the docs. Solved for me. Amplify.configure({ ...config, Analytics: { disabled: true, } });

samuthekid commented 2 years ago

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-amplify and 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:

    "@aws-amplify/analytics": "5.2.0",
    "@aws-amplify/auth": "4.4.2",
    "@aws-amplify/core": "4.4.0",
    "@aws-amplify/ui-components": "^1.9.6",
    "amazon-cognito-identity-js": "^5.2.6",
orome commented 2 years ago

If you don't use Analytics disable it like this. Acording to the docs. Solved for me. Amplify.configure({ ...config, Analytics: { disabled: true, } });

How are we supposed to know this? Where is it documented?

nikitaSazhinov commented 1 year ago

Hello,

I have been having this issue for quite a while, followed as far as I know all the threads that offer solutions. I am using Expo (46) with Amplify. I think I have tried pretty much every combination of packages, package versions, import types but if it solves one problem it creates another.

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.

dinesh-brilworks commented 11 months ago

I am having same issue while log analytics events,

Analytics.record

Using following dependancies,

    "aws-amplify": "~5.3.11",
    "aws-amplify-react-native": "~7.0.7",

using s3,

"@aws-sdk/client-s3": "~3.370.0",

julian-kingman-lark commented 10 months ago

I'm having this issue consistently. Downgrading aws-amplify is not really an option, and many imports available in @aws-amplify/[package] packages are not available as exports of aws-amplify, so I can't test that solution. And yes, I just have the single aws-amplify package installed, and have tried the options given so far.

I think it's working OK, but the logs are very irritating and make debugging a chore.

cwomack commented 6 months ago

@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?

toddaa commented 6 months ago

@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.