Android emulator + physical device work fine.
iOS simulator + iPhone fail during Metro bundling.
Error (iOS only):
Unable to resolve "../node_modules/@better-auth/expo/dist/client.cjs"
from "lib/auth-client.ts"
import { expoClient } from "@better-auth/expo/client";
Auth code:
import { expoClient } from "@better-auth/expo/client";
import { createAuthClient } from "better-auth/react";
import * as SecureStore from "expo-secure-store";
Tried (did NOT fix):
babel.config.js
alias: {
"better-auth/react":
"./node_modules/better-auth/dist/client/react/index.cjs",
"better-auth/client/plugins":
"./node_modules/better-auth/dist/client/plugins/index.cjs",
"@better-auth/expo/client":
"./node_modules/@better-auth/expo/dist/client.cjs",
}
metro.config.js
config.resolver.unstable_enablePackageExports = true;
Cache cleared, rebuilt dev client.
Android works, iOS always fails.
Has anyone got Better Auth working on Expo iOS or is this a packaging / exports bug?