React Native Clerk
I am trying top submit my app to the apple app store but it was rejected because of a bug with my Clerk integration
"Bug description: The app remained on the login page after we tapped on Continue with Google and logged in with an account."
my app is directly derived from this
https://www.convex.dev/templates/monorepo
i think the integration is similar or the same to
https://docs.convex.dev/auth/clerk
but I am currrently reviewing that and checking
Has anyone submitted a clerk app wioth clerk integration successfully to Apple?
Monorepo with Next.js and Expo
The backend application platform with everything you need to build your product.
Convex & Clerk | Convex Developer Hub
Clerk is an authentication platform providing login via
19 Replies
Is the auth totally broken, so the reviewer could not proceed? Can you replicate the issue?
yes I think I can replicate
it will log in eventually, or most the time
LOG google oauth started google
WARN [Error: ClerkJS: Network error at "https://fair-moth-69.clerk.accounts.dev/v1/client/sign_ins?_clerk_js_version=5.5.3&_is_native=1" - TypeError: Network request failed. Please try again.]
ERROR OAuth error [TypeError: Cannot read property 'toString' of null]
WARN [Error: ClerkJS: Network error at "https://fair-moth-69.clerk.accounts.dev/v1/client/sign_ins?_clerk_js_version=5.5.3&_is_native=1" - TypeError: Network request failed. Please try again.]
ERROR OAuth error [TypeError: Cannot read property 'toString' of null]
but sometimes it will just sit on the continue with google page
either before or after logging in with google. Some cobination of waiting and trying again, I think than works
or if not than I restart the app and now when I hit continue with google it just goes straight in like Im already logged in
now not logging in at all, but I haven't changed anything
and now getting a new error
OAuth error
Object
code: "ERR_WEB_BROWSER_ALREADY_OPEN"
jsEngine: "hermes"
message: "Calling the 'openAuthSessionAsync' function has failed\n→ Caused by: Another web browser is already open"
stack: "Error: Calling the 'openAuthSessionAsync' function has failed\n→ Caused by: Another web browser is already open\n at construct (native)\n at apply (native)\n at _construct (http://10.176.43.141:8081/index.tsx.bundle//&platform=ios&dev=true&hot=false&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=app:9653:67)\n at Wrapper (http://10.176.43.141:8081/index.tsx.bundle//&platform=ios&dev=true&hot=false&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=app:9625:25)\n at construct (native)\n at _callSuper (http://10.176.43.141:8081/index.tsx.bundle//&platform=ios&dev=true&hot=false&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=app:128120:170)\n at CodedError (http://10.176.43.141:8081/index.tsx.bundle//&platform=ios&dev=true&hot=false&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=app:128131:25)"
proto: {constructor: ƒ}
after killing app and restarting back to getting this error
OAuth error
Object
jsEngine: "hermes"
message: "Cannot read property 'toString' of null"
stack: "TypeError: Cannot read property 'toString' of null\n at ?anon0 (http://10.176.43.141:8081/index.tsx.bundle//&platform=ios&dev=true&hot=false&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=app:186182:49)\n at next (native)\n at asyncGeneratorStep
clerkError: true
clerkTraceId: undefined
errors: Array(1)
0:
code: "signed_out"
longMessage: "You are signed out"
message: "Signed out"
meta:
emailAddresses: undefined
identifiers: undefined
paramName: undefined
sessionId: undefined
zxcvbn: undefined
__proto__: {__proto__: null, constructor: ƒ, toString: ƒ, toLocaleString: ƒ, valueOf: ƒ, hasOwnProperty: ƒ, isPrototypeOf: ƒ, propertyIsEnumerable: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, …}
__proto__: {__proto__: null, constructor: ƒ, toString: ƒ, toLocaleString: ƒ, valueOf: ƒ, hasOwnProperty: ƒ, isPrototypeOf: ƒ, propertyIsEnumerable: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, …}
length: 1
__proto__: []
jsEngine: "hermes"
message: ""
stack: "Error\n at construct (native)\n at apply (native)\n at _construct (htt]]]]]]
...
First I would try to isolate whether this is related to Convex or not. If you remove Convex, do you still get the error? If no, you should reach out to Clerk on their discord.
I don't think its a Convex problem, but I also think its probably not a Clerk problem.
I think its a problem with https://www.convex.dev/templates/monorepo
Monorepo with Next.js and Expo
The backend application platform with everything you need to build your product.
GitHub
turbo-expo-nextjs-clerk-convex-monorepo/apps/native/src/screens/Log...
Monorepo template with Turborepo, Next.js, Expo, Clerk, Convex - get-convex/turbo-expo-nextjs-clerk-convex-monorepo
I think I missed your message from my earlier question
https://discord.com/channels/1019350475847499849/1255556057573494906/1255896155523649547
so maybe thats the problem, and I need to update my clerk version
which I think I got from that template
I see, I have never tried that approach to OAuth. Updating is a good idea, although you might want to stick to latest of v4.
i had accidentally added clerk-react, in addition to clerk/clerk-react
not sure if it's realted to this
but now the yarn warning is gone
it does appear to be Clerk as far as I can tell. Whats teh point of Clerk if it doesn't work
Thinking maybe it’s having trouble working with navigation - their example uses expo-router and links
Also convex now just announced convex auth https://www.convex.dev/auth
Convex Auth
Auth integrated right into your backend
OK - I think I've figured out when it happens
it appears things get wonky if the "Continue with Google" is pushed twice.
adding WebBrowser.maybeCompleteAuthSession(); to the on press, makes it so that it will eventually work. However if its pressed twice I still get the behavior of logging in with google but ending up back in the Login screen
the app seems to work pretty well if the internet is good and wifi is normal
was working on it in library yesterday, which has a pop up login to use wifi and the wifi is slow and was getting lots of problems
const onPress = async (authType: string) => {
try {
WebBrowser.maybeCompleteAuthSession();
I'm considering this resolved - but the template does need some updates
Not sure I'll ever get time, but if I eventually understand whats going on I'll want to make a PR to the template for the mono repo
I recommend disabling the button after the first click. This is what I do in the RN template I'm working on for Convex Auth.
that solved the problem with the browser