React native dependencies slipping into server plugin on beta #731

Closed
opened 2026-03-13 08:01:58 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @samducker on GitHub (Feb 23, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

On beta 1.2.0-beta.12 in a cloudflare workers enviroment when importing the expo plugin for setting it up during the server side auth as per the docs the react native bundle gets in causing this issue

✘ [ERROR] Build failed with 1 error:

✘ [ERROR] Unexpected "typeof"

  ./node_modules/react-native/index.js:15:7:
    15 │ import typeof ActionSheetIOS from './Libraries/ActionSheetIOS/Acti...
       ╵        ~~~~~~

Current vs. Expected behavior

Should not include react native in the server bundle as a dep.

What version of Better Auth are you using?

1.2.0-beta.12

Provide environment information

- CF workers
- Hono 
- Better auth + better auth expo plugin

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Proposed fix

Split the expo integration into two packages, or implement the server side part in core and just have the client part as a plugin.

https://github.com/better-auth/better-auth/blob/v1.2/packages/better-auth/package.json

Remove from here or move to peer deps

Originally created by @samducker on GitHub (Feb 23, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce On beta 1.2.0-beta.12 in a cloudflare workers enviroment when importing the expo plugin for setting it up during the server side auth as per the docs the react native bundle gets in causing this issue ✘ [ERROR] Build failed with 1 error: ✘ [ERROR] Unexpected "typeof" ./node_modules/react-native/index.js:15:7: 15 │ import typeof ActionSheetIOS from './Libraries/ActionSheetIOS/Acti... ╵ ~~~~~~ ### Current vs. Expected behavior Should not include react native in the server bundle as a dep. ### What version of Better Auth are you using? 1.2.0-beta.12 ### Provide environment information ```bash - CF workers - Hono - Better auth + better auth expo plugin ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Proposed fix Split the expo integration into two packages, or implement the server side part in core and just have the client part as a plugin. https://github.com/better-auth/better-auth/blob/v1.2/packages/better-auth/package.json Remove from here or move to peer deps
GiteaMirror added the bug label 2026-03-13 08:01:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#731