createAmplifyAuthAdapter fails because Amplify.geConfig is empty. #6534
Labels
pending-community-response
Issue is pending response from the issue requestor or other community members
question
General question
StorageBrowser
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Storage
How is your app built?
vite
What browsers are you seeing the problem on?
Chrome
Which region are you seeing the problem in?
ap-northeast-1
Please describe your bug.
createAmplifyAuthAdapter fails because Amplify.geConfig is empty.
When I checked the source code, I found that
Amplify.getConfig
on line 27 retrieves an empty object.Why does it become empty? My amplify_outputs.json is not empty.
I'm trying it with a minimal implementation as per the official documentation, but I get an error.
However, if I execute
Amplify.getConfig
myself just before executing createAmplifyAuthAdapter, I can get the settings.I don't understand the cause of this difference. Is it a different instance of the Amplify class? If there is an error, please let me know.
I have confirmed the following.
According to pnpm, the dependency of ui-storage seems to be up to react 18, but the result is the same with react 18.
amplify ui is imported and executed on the client side.
Authentication with Amplify is successful. So, in terms of the authentication flow, AWS.configure seems to be fine.
My environment is as follows:
What's the expected behaviour?
Help us reproduce the bug!
https://vite.dev/guide/#scaffolding-your-first-vite-project
pnpm add @aws-amplify/ui-react-storage @aws-amplify/ui-react aws-amplify
add router config and page
start server
pnpm run dev
http://localhost:3000/s3-ui-test
Code Snippet
Console log output
Additional information and screenshots
The text was updated successfully, but these errors were encountered: