better-auth/react-start not exported #1030

Closed
opened 2026-03-13 08:19:42 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @ruudandriessen on GitHub (Apr 13, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  • Install better auth
  • Try and import reactStartCookies from better-auth/react-start as suggested in tanstack start docs.

Current vs. Expected behavior

Expected to be able to import the auth middleware

What version of Better Auth are you using?

1.2.3

Provide environment information

- MacOS
- Chrome

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

Package, Client

Auth config (if applicable)

import { betterAuth } from "better-auth"
import { reactStartCookies } from "better-auth/react-start";

export const auth = betterAuth({
  plugins: [
    reactStartCookies()
  ],
});

Additional context

No response

Originally created by @ruudandriessen on GitHub (Apr 13, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce * Install better auth * Try and import reactStartCookies from `better-auth/react-start` as suggested in [tanstack start docs](https://www.better-auth.com/docs/integrations/tanstack#usage-tips). ### Current vs. Expected behavior Expected to be able to import the auth middleware ### What version of Better Auth are you using? 1.2.3 ### Provide environment information ```bash - MacOS - Chrome ``` ### Which area(s) are affected? (Select all that apply) Package, Client ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" import { reactStartCookies } from "better-auth/react-start"; export const auth = betterAuth({ plugins: [ reactStartCookies() ], }); ``` ### Additional context _No response_
Author
Owner

@Bekacru commented on GitHub (Apr 13, 2025):

it's added since 1.2.6

@Bekacru commented on GitHub (Apr 13, 2025): it's added since `1.2.6`
Author
Owner

@siddharth-narayan commented on GitHub (Apr 13, 2025):

I'm on 1.2.6 and am getting the same issue. I'm trying to

import { createAuthClient } from "better-auth/react"

but it's not found.

Do I need to npm install better-auth/react? That fails as well.

@siddharth-narayan commented on GitHub (Apr 13, 2025): I'm on ```1.2.6``` and am getting the same issue. I'm trying to ```ts import { createAuthClient } from "better-auth/react" ``` but it's not found. Do I need to ```npm install better-auth/react```? That fails as well.
Author
Owner

@siddharth-narayan commented on GitHub (Apr 13, 2025):

It was a problem with Metro for me - config.resolver.unstable_enablePackageExports = true had to be set

@siddharth-narayan commented on GitHub (Apr 13, 2025): It was a problem with Metro for me - ```config.resolver.unstable_enablePackageExports = true``` had to be set
Author
Owner

@23Aryansharma11 commented on GitHub (Sep 6, 2025):

Facing the same issue

import { createAuthClient } from "better-auth/react";

export const authClient = createAuthClient({
  baseURL: "http://localhost:3000",
}); 

Uncaught Error: Could not resolve "react" imported by "better-auth". Is it installed? at optional-peer-dep:__vite-optional-peer-dep:react:better-auth:false (better-auth_react.js?v=a83dde4b:10:11) at __require (chunk-5WRI5ZAA.js?v=a83dde4b:8:50) at better-auth_react.js?v=a83dde4b:1253:28 optional-peer-dep:__vite-optional-peer-dep:react:better-auth:false @ better-auth_react.js?v=a83dde4b:10 __require @ chunk-5WRI5ZAA.js?v=a83dde4b:8 (anonymous) @ better-auth_react.js?v=a83dde4b:1253

@23Aryansharma11 commented on GitHub (Sep 6, 2025): Facing the same issue ``` import { createAuthClient } from "better-auth/react"; export const authClient = createAuthClient({ baseURL: "http://localhost:3000", }); ``` ` Uncaught Error: Could not resolve "react" imported by "better-auth". Is it installed? at optional-peer-dep:__vite-optional-peer-dep:react:better-auth:false (better-auth_react.js?v=a83dde4b:10:11) at __require (chunk-5WRI5ZAA.js?v=a83dde4b:8:50) at better-auth_react.js?v=a83dde4b:1253:28 optional-peer-dep:__vite-optional-peer-dep:react:better-auth:false @ better-auth_react.js?v=a83dde4b:10 __require @ chunk-5WRI5ZAA.js?v=a83dde4b:8 (anonymous) @ better-auth_react.js?v=a83dde4b:1253 `
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1030