I'm using aws cognito userpool (email, pw) inside react native app. Uploading image to public s3 bucket works on debug mode. But in the release mode it fails with following error.
ReactNativeJS: { '[WARN] 01:25.693 StorageClass - ensure credentials error': { [TypeError: undefined is not a function (evaluating 'e.getPromise()')] line: 422, column: 8928, sourceURL: 'index.android.bundle' } }
ReactNativeJS:No credentials'
Inside, node_modules/@aws-amplify/core/Credentials.js (line 253)
var credentials = new Facet_1.AWS.CognitoIdentityCredentials({
IdentityPoolId: identityPoolId,
Logins: logins
}, {
region: region
});
This gets expired 'credentials' only in release mode. This leads to no credentials error.
./gradlew assembleRelease && ./gradlew installRelease
(not after react-native run-android
)Can anyone reproduce this and give some insight?
Thanks for raising the concern, I have also been facing the issue. Was wasting a lot of time with this.
Seems to be related to #1241
@malithjkmt can you open the debug mode by putting window.LOG_LEVEL='DEBUG'
in your code?
@malithjkmt I tried on the IOS emulator and things work fine for me. Are you using the Amplify like this:
import aws_exports from './aws-exports';
import Auth from '@aws-amplify/auth';
import Amplify from '@aws-amplify/core';
import Storage from '@aws-amplify/storage';
Amplify.configure(aws_exports);
class App extends Component<Props> {
// do something with Storage
}
@powerful23 thanks for the suggestions, below is the log after I put window.LOG_LEVEL='DEBUG'
[DEBUG] 14:10.364 Credentials - getting credentials
07-21 06:14:10.364 27696 28004 I ReactNativeJS: [DEBUG] 14:10.364 Credentials - picking up credentials
07-21 06:14:10.364 27696 28004 I ReactNativeJS: [DEBUG] 14:10.364 Credentials - getting new cred promise
07-21 06:14:10.364 27696 28004 I ReactNativeJS: [DEBUG] 14:10.364 Credentials - checking if credentials exists and not expired
07-21 06:14:10.364 27696 28004 I ReactNativeJS: [DEBUG] 14:10.364 Credentials - need to get a new credential or refresh the existing one
07-21 06:14:10.364 27696 28004 I ReactNativeJS: [DEBUG] 14:10.364 AuthClass - Getting current user credentials
07-21 06:14:10.365 27696 28004 I ReactNativeJS: { '[DEBUG] 14:10.364 AuthClass - failed to get or parse item aws-amplify-federatedInfo': { [SyntaxError: JSON Parse error: Unexpected identifier "undefined"] line: 449, column: 16321, sourceURL: 'index.android.bundle' } }
07-21 06:14:10.365 27696 28004 I ReactNativeJS: [DEBUG] 14:10.365 AuthClass - Getting current session
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { '[DEBUG] 14:10.367 AuthClass - Getting the session from this user:':
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { username: 'xxxxxxxx',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: pool:
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { userPoolId: 'ap-southeast-xxx',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: clientId: 'xxxxxx',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: client:
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { endpoint: 'https://cognito-idp.ap-southeast-1.amazonaws.com/',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: userAgent: 'aws-amplify/0.1.x react-native' },
07-21 06:14:10.370 27696 28004 I ReactNativeJS: advancedSecurityDataCollectionFlag: true,
07-21 06:14:10.370 27696 28004 I ReactNativeJS: storage:
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { [Function: t]
07-21 06:14:10.370 27696 28004 I ReactNativeJS: setItem: [Function],
07-21 06:14:10.370 27696 28004 I ReactNativeJS: getItem: [Function],
07-21 06:14:10.370 27696 28004 I ReactNativeJS: removeItem: [Function],
07-21 06:14:10.370 27696 28004 I ReactNativeJS: clear: [Function],
07-21 06:14:10.370 27696 28004 I ReactNativeJS: sync: [Function] } },
07-21 06:14:10.370 27696 28004 I ReactNativeJS: Session: null,
07-21 06:14:10.370 27696 28004 I ReactNativeJS: client:
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { endpoint: 'https://cognito-idp.ap-southeast-1.amazonaws.com/',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: userAgent: 'aws-amplify/0.1.x react-native' },
07-21 06:14:10.370 27696 28004 I ReactNativeJS: signInUserSession:
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { idToken:
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { jwtToken: 'xxxx...',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: payload:
07-21 06:14:10.370 27696 28004 I ReactNativeJS: { sub: 'xxxx',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: aud: 'xxxxx',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: email_verified: true,
07-21 06:14:10.370 27696 28004 I ReactNativeJS: event_id: 'e9c1a4f4-8c7e-11e8-af9e-c9815765d44c',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: token_use: 'id',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: auth_time: 1532133735,
07-21 06:14:10.370 27696 28004 I ReactNativeJS: iss: 'https://cognito-idp.ap-southeast-1.amazonaws.com/ap-southeast-xxxxx',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: name: 'john doe',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: 'cognito:username': 'xxxxxx',
07-21 06:14:10.370 27696 28004 I ReactNativeJS: exp: 1532137335,
07-21 06:14:10.370 27696 28004 I ReactNativeJS: iat: 1532133735,
07-21 06:14:10.370 27696 28004 I ReactNativeJS: email: 'xxx@xxxx' } },
07-21 06:14:10.370 27696 28004 I ReactNativeJS: refreshToken: { token: 'xxxx...'
07-21 06:14:10.372 27696 28004 I ReactNativeJS: { '[DEBUG] 14:10.370 AuthClass - Succeed to get the user session':
07-21 06:14:10.372 27696 28004 I ReactNativeJS: { idToken:
07-21 06:14:10.372 27696 28004 I ReactNativeJS: { jwtToken: 'xxxx...',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: payload:
07-21 06:14:10.372 27696 28004 I ReactNativeJS: { sub: 'xxx',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: aud: 'xxx',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: email_verified: true,
07-21 06:14:10.372 27696 28004 I ReactNativeJS: event_id: 'e9c1a4f4-8c7e-11e8-af9e-c9815765d44c',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: token_use: 'id',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: auth_time: 1532133735,
07-21 06:14:10.372 27696 28004 I ReactNativeJS: iss: 'https://cognito-idp.ap-southeast-1.amazonaws.com/ap-southeast-1_xxxx',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: name: 'John Doe',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: 'cognito:username': 'xxxx',
07-21 06:14:10.372 27696 28004 I ReactNativeJS: exp: 1532137335,
07-21 06:14:10.372 27696 28004 I ReactNativeJS: iat: 1532133735,
07-21 06:14:10.372 27696 28004 I ReactNativeJS: email: 'xxx@xxx' } },
07-21 06:14:10.372 27696 28004 I ReactNativeJS: refreshToken: { token: 'xxxx...' },
07-21 06:14:10.372 27696 28004 I ReactNativeJS: accessToken:
07-21 06:14:10.372 27696 28004 I ReactNativeJS: { jwtToken: 'xxx...'
07-21 06:14:10.374 27696 28004 I ReactNativeJS: { '[DEBUG] 14:10.373 AuthClass - getting session success':
07-21 06:14:10.374 27696 28004 I ReactNativeJS: { idToken:
07-21 06:14:10.374 27696 28004 I ReactNativeJS: { jwtToken: 'xxx...',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: payload:
07-21 06:14:10.374 27696 28004 I ReactNativeJS: { sub: 'xxx',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: aud: 'xx',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: email_verified: true,
07-21 06:14:10.374 27696 28004 I ReactNativeJS: event_id: 'e9c1a4f4-8c7e-11e8-af9e-c9815765d44c',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: token_use: 'id',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: auth_time: 1532133735,
07-21 06:14:10.374 27696 28004 I ReactNativeJS: iss: 'https://cognito-idp.ap-southeast-1.amazonaws.com/ap-southeast-1_xxxx',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: name: 'John Doe',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: 'cognito:username': 'xxx',
07-21 06:14:10.374 27696 28004 I ReactNativeJS: exp: 1532137335,
07-21 06:14:10.374 27696 28004 I ReactNativeJS: iat: 1532133735,
07-21 06:14:10.374 27696 28004 I ReactNativeJS: email: 'xxx@xxx' } },
07-21 06:14:10.374 27696 28004 I ReactNativeJS: refreshToken: { token: 'xxx...' },
07-21 06:14:10.374 27696 28004 I ReactNativeJS: accessToken:
07-21 06:14:10.374 27696 28004 I ReactNativeJS: { jwtToken: 'xxx...'
07-21 06:14:10.374 27696 28004 I ReactNativeJS: [DEBUG] 14:10.374 Credentials - set credentials from session
07-21 06:14:10.375 27696 28004 I ReactNativeJS: { '[DEBUG] 14:10.375 AuthClass - getting session failed': { [TypeError: undefined is not a function (evaluating 'e.getPromise()')] line: 422, column: 8928, sourceURL: 'index.android.bundle' } }
07-21 06:14:10.375 27696 28004 I ReactNativeJS: [DEBUG] 14:10.375 Credentials - setting credentials for guest
07-21 06:14:10.376 27696 28004 W ReactNativeJS: { '[WARN] 14:10.376 StorageClass - ensure credentials error': { [TypeError: undefined is not a function (evaluating 'e.getPromise()')] line: 422, column: 8928, sourceURL: 'index.android.bundle' } }
07-21 06:14:10.377 27696 28004 I ReactNativeJS: No credentials
Previously I've used Amplify like this.
import Amplify, { Auth } from 'aws-amplify';
import awsConfigs from '../../aws-exports';
Amplify.configure(awsConfigs);
But, changing to @ style didn't change anything.
After raising this issue, I moved back to uploading image using signed urls with 'aws-sdk'
(new AWS.S3(...)).getSignedUrl()
Today, when I change the code back to Amplify put() method, while having the 'aws-sdk' in the node_modules... it threw the #1241 issue in the debug mode.
After removing 'aws-sdk' it worked in the debug mode without any issue.
But, as early.. it throws 'no credentials' error in release mode ANDROID.
@malithjkmt seems like the the undefined credentials
is causing the problem. { '[DEBUG] 14:10.375 AuthClass - getting session failed': { [TypeError: undefined is not a function (evaluating 'e.getPromise()')] line: 422, column: 8928, sourceURL: 'index.android.bundle' } }
and https://github.com/aws-amplify/amplify-js/blob/master/packages/core/src/Credentials.ts#L249, could you try to find out why the credentials object is undefined? You can put your console log in node_modules/@aws-amplify/core/lib/Credentials.js
. Thanks!
@powerful23 @malithjkmt Where do you add the Debug statement? I am running the release build on my physical device via xcode. I tried added the statement you mentioned after and before Amplify.configure(...) but I dont see any debug logs.
@powerful23 As you pointed out above there is definitely an issue the credentials object being undefined. This issue only happens in release mode so it is very difficult to debug an know why. I spent several hours with amazon support on this issue. Can the amplify/aws-sdk team please debug this further.
@makeitraina you can add window.LOG_LEVEL='DEBUG'
inside index.js
window.LOG_LEVEL='DEBUG'
AppRegistry.registerComponent('MyApp', () => App);
@makeitraina can you try to use xcode's logging console to read those logs under the release mode?
I'm having a very similar issue. I'm just using the Analytics module. When i run a custom Analytics.record('test')
it works in debug mode but not release. It was working until my last update when i started using React-Native 0.56, though i'm not entirely sure that upgrade from 0.55 to 0.56 is the cause. When i look at the logs in debug mode when i trigger my test event i see the following:
07-24 15:25:58.948 31732 31804 I ReactNativeJS: [DEBUG] 25:58.948 Credentials - picking up credentials
07-24 15:25:58.948 31732 31804 I ReactNativeJS: [DEBUG] 25:58.948 Credentials - getting new cred promise
07-24 15:25:58.948 31732 31804 I ReactNativeJS: [DEBUG] 25:58.948 Credentials - checking if credentials exists and not expired
07-24 15:25:58.956 31732 31804 I ReactNativeJS: { '[DEBUG] 25:58.949 Credentials - is this credentials expired?':
07-24 15:25:58.956 31732 31804 I ReactNativeJS: { expired: false,
07-24 15:25:58.956 31732 31804 I ReactNativeJS: expireTime: Tue Jul 24 2018 16:25:00 GMT-0400 (EDT),
07-24 15:25:58.956 31732 31804 I ReactNativeJS: accessKeyId: 'xxxx',
07-24 15:25:58.956 31732 31804 I ReactNativeJS: sessionToken: ‘xxx',
07-24 15:25:58.956 31732 31804 I ReactNativeJS: params:
07-24 15:25:58.956 31732 31804 I ReactNativeJS: { IdentityPoolId: 'xxx',
07-24 15:25:58.956 31732 31804 I ReactNativeJS: IdentityId: 'xxx',
07-24 15:25:58.956 31732 31804 I ReactNativeJS: RoleSessionName: 'web-identity' },
07-24 15:25:58.956 31732 31804 I ReactNativeJS: data:
...
07-24 15:25:59.228 31732 31804 I ReactNativeJS: [DEBUG] 25:59.228 AWSPinpointProvider - init clients
07-24 15:25:59.229 31732 31804 I ReactNativeJS: [DEBUG] 25:59.228 AWSPinpointProvider - no change for aws credentials, directly return from init
07-24 15:25:59.231 31732 31804 I ReactNativeJS: { '[DEBUG] 25:59.229 AWSPinpointProvider - record event with params':
07-24 15:25:59.231 31732 31804 I ReactNativeJS: { clientContext: '{"client":{"client_id”:”xxx"},"env":{"platform":"android","platform_version":"24"},"services":{"mobile_analytics":{"app_id”:"xxx","sdk_name":"aws-amplify/0.4.x react-native"}}}',
07-24 15:25:59.231 31732 31804 I ReactNativeJS: events:
07-24 15:25:59.231 31732 31804 I ReactNativeJS: [ { eventType: 'test',
07-24 15:25:59.231 31732 31804 I ReactNativeJS: timestamp: '2018-07-24T19:25:58.967Z',
07-24 15:25:59.231 31732 31804 I ReactNativeJS: attributes: undefined,
07-24 15:25:59.231 31732 31804 I ReactNativeJS: metrics: undefined } ] } }
07-24 15:25:59.484 31732 31804 I ReactNativeJS: { '[DEBUG] 25:59.483 AWSPinpointProvider - record event success. ': {} }
and in the release build i get:
07-24 15:17:03.638 22484 22523 I ReactNativeJS: [DEBUG] 17:03.636 Credentials - getting credentials
07-24 15:17:03.638 22484 22523 I ReactNativeJS: [DEBUG] 17:03.638 Credentials - picking up credentials
07-24 15:17:03.640 22484 22523 I ReactNativeJS: [DEBUG] 17:03.639 Credentials - getting new cred promise
07-24 15:17:03.640 22484 22523 I ReactNativeJS: [DEBUG] 17:03.640 Credentials - checking if credentials exists and not expired
07-24 15:17:03.641 22484 22523 I ReactNativeJS: [DEBUG] 17:03.640 Credentials - need to get a new credential or refresh the existing one
07-24 15:17:03.641 22484 22523 I ReactNativeJS: [DEBUG] 17:03.641 AuthClass - Getting current user credentials
07-24 15:17:03.654 22484 22523 I ReactNativeJS: { '[DEBUG] 17:03.642 AuthClass - failed to get or parse item aws-amplify-federatedInfo': { [SyntaxError: JSON Parse error: Unexpected identifier "undefined"] line: 447, column: 14696, sourceURL: 'index.android.bundle' } }
07-24 15:17:03.656 22484 22523 I ReactNativeJS: [DEBUG] 17:03.654 AuthClass - Getting current session
07-24 15:17:03.659 22484 22523 I ReactNativeJS: { '[DEBUG] 17:03.658 AuthClass - getting session failed': 'No userPool' }
07-24 15:17:03.659 22484 22523 I ReactNativeJS: [DEBUG] 17:03.659 Credentials - setting credentials for guest
07-24 15:17:03.662 22484 22523 I ReactNativeJS: { '[DEBUG] 17:03.661 AWSPinpointProvider - ensure credentials error': { [TypeError: undefined is not a function (evaluating 'e.getPromise()')] line: 420, column: 8928, sourceURL: 'index.android.bundle' } }
I've tried reinitializing my project through awsmobile init
. Also @makeitraina, if you're wondering how to see the logs in while running your release build on a physical device i just run react-native log-android
in my terminal. See: https://facebook.github.io/react-native/docs/debugging.html#accessing-console-logs. However i've also ejected my app...
@SirNeuman so you are only using @aws-amplify/auth
and @aws-amplify/analytics
right?
@SirNeuman @malithjkmt thanks for the tip, I can see the logs now and Im seeing the sane e.getPromise() error.
@powerful23 what are the next steps to solving this problem? This problem is only happening on release builds so it is a production blocking issue. Please advise.
@makeitraina It would be great if we could reproduce this issue but I didn't have this problem when I tried on my machine. If you could provide some more details like how you installed, used the library in your codebase and how you built it so that we can reproduce it.
Also what you can try to debug locally is to locate why the credentials is undefined. You can write your own logs by hacking into files like node_modules/@aws-ampilfy/core/lib/Credentials.js
to see what's happening in the run time.
@powerful23 are you definitely trying to reproduce this issue on a release build? I've looked through the code for aws-amplify and aws-sdk and can definitely see that the credentials object should have the getPromise function as a property however for whatever reason it is missing in the when its run.
This is what the credential object looks like in the debug logs:
{ expired: true,
expireTime: null,
accessKeyId: undefined,
sessionToken: undefined,
params:
{ IdentityPoolId: 'xxxxxx',
Logins: { 'xxxxxx': 'xxxx' } },
data: null,
_identityId: null,
_clientConfig: { region: 'xxxxxx' } }
What version of react-native are you using? My dependencies looks like this:
"dependencies": {
"aws-amplify": "^1.0.2",
"aws-amplify-react-native": "^1.0.2",
"native-base": "^2.7.0",
"prop-types": "^15.0.0",
"react": "16.4.1",
"react-native": "0.56.0",
"react-navigation": "^2.6.2"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.47",
"babel-core": "^6.26.3",
"babel-jest": "23.2.0",
"babel-preset-react-native": "^5",
"jest": "23.3.0",
"react-test-renderer": "16.4.1"
},
Im looking through the react changelog and can see that version 0.56 uses babel 7 which is not backwards compatible so some libraries need to be updated.
https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md
I also seem to be experiencing the same issue for Storage.get() in release builds only.
As per original post Storage.get() returns "No credentials" error for both IOS and Android in release only - emulator/debug builds work fine on both platforms
"aws-amplify": "^1.0.2"
"react-native": "0.56.0"
"react": "16.4.1"
"babel-preset-react-native": "^5"
I'm running a "vanilla" RN56 build rather than an upgrade from a previous version and has only ever had aws-amplify in project - e.g no aws-sdk/amazon-cognito-identity-js
@powerful23 i'm actually just trying to use the Amplify Analytics Library for tracking custom events in my app. This is basically all i have in my code trying to get it to work:
index.js:
import Amplify from 'aws-amplify';
import AppComponent from './appComponent';
Amplify.configure(aws_exports);
class App extends Component {
render() {
return (
<AppComponent />
);
}
}
appComponent.js:
import { Analytics } from 'aws-amplify';
class AppComponent extends Component {
onBtnPress = () => {
Analytics.record('test');
}
render() {
return (
<TouchableOpacity
onPress={this.onBtnPress}/>
);
}
}
I'll try going back and looking deeper at the logs. I'll also try utilizing the modular imports in the newer release. The hard part about about trying to debug it is that the error only happens in the release build.
So after putting in a logs all over @aws-amplify/core/lib/Credentials
I found that when it tries to call _setCredentialsForGuest()
, in case 1
when it calls _loadCredentials()
, credentials.getPromise()
never returns in my release build, whereas it does in dev. I tried logging the credentials
instance created around line 190 (i forget where the actual line is because i've been inserting debug statements everywhere), where it says:
credentials = new Facet_1.AWS.CognitoIdentityCredentials({
IdentityPoolId: identityPoolId,
IdentityId: identityId ? identityId : undefined
}, {
region: region
});
and found that in my dev environment, credentials
looks like this:
07-25 11:14:02.848 21788 22016 I ReactNativeJS: { '[DEBUG] 14:02.846 Credentials':
07-25 11:14:02.848 21788 22016 I ReactNativeJS: { expired: true,
07-25 11:14:02.848 21788 22016 I ReactNativeJS: expireTime: null,
07-25 11:14:02.848 21788 22016 I ReactNativeJS: accessKeyId: undefined,
07-25 11:14:02.848 21788 22016 I ReactNativeJS: sessionToken: undefined,
07-25 11:14:02.848 21788 22016 I ReactNativeJS: params:
07-25 11:14:02.848 21788 22016 I ReactNativeJS: { IdentityPoolId: 'xxxxx',
07-25 11:14:02.848 21788 22016 I ReactNativeJS: IdentityId: 'xxxx' },
07-25 11:14:02.848 21788 22016 I ReactNativeJS: data: null,
07-25 11:14:02.848 21788 22016 I ReactNativeJS: _identityId: null,
07-25 11:14:02.848 21788 22016 I ReactNativeJS: _clientConfig: { region: 'us-east-1' } } }
and in the release build it looks like:
{ '[DEBUG] 22:10.590 Credentials':
07-25 11:22:10.592 23091 23129 I ReactNativeJS: { expired: true,
07-25 11:22:10.592 23091 23129 I ReactNativeJS: expireTime: null,
07-25 11:22:10.592 23091 23129 I ReactNativeJS: accessKeyId: undefined,
07-25 11:22:10.592 23091 23129 I ReactNativeJS: sessionToken: undefined,
07-25 11:22:10.592 23091 23129 I ReactNativeJS: params:
07-25 11:22:10.592 23091 23129 I ReactNativeJS: { IdentityPoolId: xxxxx',
07-25 11:22:10.592 23091 23129 I ReactNativeJS: IdentityId: undefined },
07-25 11:22:10.592 23091 23129 I ReactNativeJS: data: null,
07-25 11:22:10.592 23091 23129 I ReactNativeJS: _identityId: null,
07-25 11:22:10.592 23091 23129 I ReactNativeJS: _clientConfig: { region: 'us-east-1' } } }
The difference here is that IdentityId
is undefined
, even though IdentityPoolId
is the same in both cases. It looks like where it calls this._storage.getItem('CognitoIdentityId-' + identityPoolId);
it returns undefined
in release whereas it returns the correct value dev.
Guys I got this error too in the release mode. Will look into that.
I could not figure out why getPromise
was not set in the credentials object so I ended up updating the credentials.js
file directly. getPromise
is just a simple wrapper that promisifies the get
property function of credentials. Here is my patched credentials.js
@malithjkmt @SirNeuman @develop-stuartohare @anuradhawick I replaced node_modules/aws-sdk/lib/credentials.js
with the link I shared as a temporary work-around. Hopefully @powerful23 can find the root-cause and provide a proper update.
@makeitraina yeah, I made it work by using credentials.get()
instead of credential.getPromise()
. Will send a pr to fix this in amplify side and also raise this issue to the aws-sdk team.
Just checked my app using latest update and it appears to be working for me now. Thanks @powerful23!
Most helpful comment
@makeitraina yeah, I made it work by using
credentials.get()
instead ofcredential.getPromise()
. Will send a pr to fix this in amplify side and also raise this issue to the aws-sdk team.