Nishil Faldu
Nishil Faldu3w ago

Error(s) in expo

I am relatively new to expo, only building my very first native app. I use a monorepo setup and install the backend in my expo app. Has anyone encountered such a thing before?
No description
3 Replies
Nishil Faldu
Nishil FalduOP3w ago
a part of metro.config.js file
config.resolver.extraNodeModules = {
"@aws-sdk/client-s3": require.resolve("./stubs/empty.js"),
"@aws-sdk/s3-request-presigner": require.resolve("./stubs/empty.js"),
"@convex-dev/aggregate": require.resolve("./stubs/empty.js"),
"@convex-dev/migrations": require.resolve("./stubs/empty.js"),
"@convex-dev/expo-push-notifications": require.resolve("./stubs/empty.js"),
"oslo/crypto": require.resolve("./stubs/empty.js"),
"@convex-dev/auth": require.resolve("./stubs/empty.js"),
// Add other server-only libs here if needed
};
config.resolver.extraNodeModules = {
"@aws-sdk/client-s3": require.resolve("./stubs/empty.js"),
"@aws-sdk/s3-request-presigner": require.resolve("./stubs/empty.js"),
"@convex-dev/aggregate": require.resolve("./stubs/empty.js"),
"@convex-dev/migrations": require.resolve("./stubs/empty.js"),
"@convex-dev/expo-push-notifications": require.resolve("./stubs/empty.js"),
"oslo/crypto": require.resolve("./stubs/empty.js"),
"@convex-dev/auth": require.resolve("./stubs/empty.js"),
// Add other server-only libs here if needed
};
i am tired of declaring them as extraNodeModules - they always keep coming and I have to add more
erquhart
erquhart3w ago
Hmm I use convex auth with expo and haven't had to do this You may be importing from your convex directory into your native app in such a way that server imports are being included, that's my guess. You should generally only be importing from convex/_generated to your client. I think, at least, nothing comes to mind that should be imported from outside that directory. Shared code between client and convex should live in a directory outside of the convex directory as well.
Nishil Faldu
Nishil FalduOP3w ago
that makes sense. i do have a few instances where i have some code imported in client and not from the generated directory. I will try to get rid of those and see if it resolves the issue. thank you. will text an update when i have one fixed! thank you @erquhart . appreciate the help!

Did you find this page helpful?