NextJS build error

Hello, I'm trying to run the NextJS project build with better-auth but I'm getting the error. Could someone help me?

Failed to compile.

./node_modules/better-auth/dist/client/react/index.mjs
Attempted import error: 'useRef' is not exported from 'react' (imported as 'useRef').

Import trace for requested module:
./node_modules/better-auth/dist/client/react/index.mjs
./src/lib/auth-client.ts

./node_modules/better-auth/dist/client/react/index.mjs
Attempted import error: 'useSyncExternalStore' is not exported from 'react' (imported as 'useSyncExternalStore').

Import trace for requested module:
./node_modules/better-auth/dist/client/react/index.mjs
./src/lib/auth-client.ts
image.png
Was this page helpful?