amplify-js: Configured event breaking change not documented
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
Angular, Not applicable
Amplify APIs
Authentication, Storage
Amplify Categories
auth, storage
Environment information
System:
OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
Memory: 48.32 GB / 62.47 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.18.2 - /tmp/xfs-705df71f/node
Yarn: 3.5.0 - /tmp/xfs-705df71f/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
npmGlobalPackages:
corepack: 0.19.0
npm: 9.8.1
yarn: 1.22.19
Describe the bug
Before the v6, there used to be a configured event in the auth channel. There is no mention of this anywhere of this event in the migration. How can one know when she can use the storage if the auth part is not authenticated yet ?
Expected behavior
Either the Amplify.configure should return a promise or we need the configured event back or a way to know when Storage is usable
Reproduction steps
- Setup amplify for auth and storage
- Just after the
Amplify.configureline, try to download a file from s3. - The runtimes throws
NoCredentials: Credentials should not be empty.
Code Snippet
// Put your code below this line.
Log output
[DEBUG] 06:37.58 Hub - Dispatching to core with {event: 'configure', data: {…}}
ConsoleLogger.mjs:86 [DEBUG] 06:37.60 Hub - Dispatching to core with {event: 'configure', data: {…}}
13 error-handler.ts:12 NoCredentials: Credentials should not be empty.
aws-exports.js
{ Auth: { Cognito: { identityPoolId: env.identity_pool_id, userPoolId: env.user_pool_id, userPoolClientId: env.app_client_id, signUpVerificationMethod: ‘code’, loginWith: { oauth: { “domain”: env.login_domain, “scopes”: [ “email”, “openid”, “profile”, “aws.cognito.signin.user.admin” ], “redirectSignIn”: [new URL(location.getBaseHref() + ‘oauth’, window.location.href).toString()], redirectSignOut: [new URL(location.getBaseHref(), window.location.href).toString()], “responseType”: “code” }, } } }, Storage: { S3: { bucket: env.s3_upload_bucket, region: aws.region } } }
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 1
- Comments: 17 (7 by maintainers)
As you mentioned, I have unauthenticated users. I had tried the fetchAuthSession, but it did not work out either.
@npenin, thanks for the confirmation. I’ll label this as a bug for now then and review it with the team internally. Will provide updates via this issue as soon as I can!
@cwomack yes, that’s exactly the problem. I am loading a configuration file in my app to then load everything else. However without this
configuredevent that was present in v5, I have no way to achieve the same in v6.