-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@aws-amplify/ui-react-native withAuthenticator and <Authenticator.Provider> works on web but fails on mobile when using expo-router #5175
Comments
Hi @drewboardman thanks for creating issue and for providing a reproduction. We'll look into this and follow up with you. |
@drewboardman the
I was able to get your sample app running using those commands. Let us know if this resolves your issue. |
Interesting 🤔 . Any idea why this seems to only manifest with expo-router? I added the same authenticator to your "sample tutorial" application (the one with the images and emoji) and everything works as expected (with expo go). Here is the working example: https://github.com/drewboardman/tutorial-with-amplify-working Also, any idea on where I would find error logs for this issue? |
@esauerbo I ran Can you provide more details of how you got this working? |
Because Expo Go isn't officially supported, it may happen to work in some cases but isn't required to work. The "actual" reason would be dependent to the implementation of
I didn't actually make any changes, just followed your reproduction steps but with Can you try making a simpler app just using expo router and see if you have the same problem? It seems like the issue is with the app not mounting properly, so I don't believe there would be Authenticator-specific error logs here. |
My main confusion is that the app (even with Expo Go) works correctly when I change the line:
NOTE: this is in addition to removing the:
Is it possibly some versioning issue with our NPM or something? Maybe my xcode or android studio? Is there some way that I can debug the difference between my development environment and yours? I'm pretty motivated to understand why I'm seeing different results from your |
@esauerbo I built the project in xcode using the
|
Hi @drewboardman, Were you able to get this working in an application using regular Expo (not Expo Go)? While you may have gotten things rendering originally with Expo Go, there would likely be a flow that would fail with Go. One thing you might try would be rendering the Authenticator in a "SignIn" route rather than wrapping the router in the Authenticator. You could use one of the JS api's like getCurrentUser to check if the user is logged in and only render the Authenticator if there is no user. |
I'm not able to be at my computer right now to try your suggestion, but I have not been able to reproduce the successful Auth that the other responder mentioned. |
@drewboardman Just following up to see if you've had a chance to try my suggestion using regular Expo. |
Hi @reesscot. I've tried regular expo, as well as building the app natively in xcode. All of them produce the same result. Are you able to run the sample code with regular expo? Can you see the authentication page? |
@drewboardman Sorry for the delayed response. Yes, I'm able to run your repo with regular expo and I'm able to see the Auth page. Were you able to get it working on your end? |
Sorry I was unable to use my personal computer recently to attempt this again. I'm now able to dedicate more time to fixing this. I will investigate further and try to replicate your results. Do you have a similar warning to this?
|
@drewboardman, we still haven't been able to reproduce the issues on our side. When you get a chance to update the versions of your dependencies to the necessary/expected values on your personal computer, let us know! |
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React Native, iOS, Android, Other
Which UI component?
Authenticator
How is your app built?
expo
What browsers are you seeing the problem on?
iOS (React Native), Android (React Native)
Which region are you seeing the problem in?
local development
Please describe your bug.
Here is a repository I created that contains a reproducible minified example of the issue. There is also a stack overflow thread describing a similar issue, however that issue has logs.
This seems to explicitly be an issue with
expo-router
's interaction with'@aws-amplify/ui-react-native'
. The issue persists with both<Authenticator.Provider>
andwithAuthenticator
.Issue
the higher-order component
withAuthenticator
works as expected on webdoes not work on mobile (iOS or Android)
Here are images of the issue: images for all three
platforms
To Reproduce
git clone
this repositorynpm
packages withnpm install
npx expo start
w
in the terminal or visitinglocalhost:8081
i
(if on a Mac)a
What's the expected behaviour?
The expected behavior is to display the login and authentication screens. I'd also like to see error logs somehow. There are no logs whatsoever.
Help us reproduce the bug!
There are detailed instructions in the README of the linked repo. I also included them at the top of this bug report.
Code Snippet
Console log output
no logs
Additional information and screenshots
https://imgur.com/a/FtJzuoo
The text was updated successfully, but these errors were encountered: