[Convex Auth]: Monorepo Expo app: "Unable to resolve @convex-dev/auth/server" ...
Hi, we're building a Turbo Monorepo Expo app and are running into the error pasted below when running the Expo dev server from our native package. The error occurs during bundling when we try to open our iOS app.
Our native app in
apps/native/package.json
has a dependency on packages/backend
as "@flimmer/backend": "*",
The iOS device error gives this information:
Thank you!6 Replies
You probably need the rest of https://github.com/get-convex/convex-auth/pull/39/files
I'll let you know when it's fixed
Thanks @Michal Srb. Any idea of when this fix might be rolled out? And is there any way we could temporarily implement this fix now, if we want to?
@djbalin try it now with 0.0.46
@Michal Srb Thank you very much for the swift action Michal! We are running into a different but similar issue now. The oslo package cannot be resolved from
@convex-dev\auth\dist\server\implementation.js
(see attached screenshot of CLI and grandfather screenshot of physical device). If you know of a temporary/ghetto fix that we can employ and leave you with some peace of mind to look into this further, please let me know 🙂Hmm, then this might not be a viable path. I have an Expo app working with Convex Auth, so this must be specific to Turborepo + Expo. Will talk with @ballingt later on how to resolve this.
One thing that might help you figure this out is that your mobile frontend should not need
@convex-dev/auth/server
. It should only depend on your backend for types. This is how the non-monorepo Expo setup works.I think I found and resolved the issue! What you mentioned here was key: "your mobile frontend should not need @convex-dev/auth/server. It should only depend on your backend for types."
Our file
backend/convex/utils.ts
contained this helper function (which was currently not being used anywhere actually):
However, our frontend/native app uses a yatesShuffle
helper function also found within this same file. This means that, as far as my rough understanding goes, when the native app uses yatesShuffle, it must parse the entire utils.ts
file which then imports schema from './schema.ts'
, somehow causing the node module resolution error. Simply commenting out the import schema
business above seems to have done the trick! Now our native app doesn't try to parse the schema.ts
file, and the error has disappeared.
I'll update you here if we run into further issues, but otherwise thank you so much for the quick help @Michal Srb! 🌞