Export createAdapterFactory doesn't exist in target module

I am integrating Better Auth with Convex in a NextJS 16 project. I followed this documentation step by step: https://www.better-auth.com/docs/integrations/convex#using-better-auth-from-the-server I am getting this issue: Error Type Build Error Error Message Export createAdapterFactory doesn't exist in target module Build Output ./node_modules/.pnpm/@convex-dev+better-auth@0.9_807d8382518d7307d7daede45ce7d913/node_modules/@convex-dev/better-auth/dist/esm/client/adapter.js:1:1 Export createAdapterFactory doesn't exist in target module
1 | import { createAdapterFactory, } from "better-auth/adapters";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | import { createFunctionHandle, } from "convex/server"; 3 | import { asyncMap } from "convex-helpers"; 4 | import { prop, sortBy, unique } from "remeda"; The export createAdapterFactory was not found in module [project]/node_modules/.pnpm/better-auth@1.3.8_react-dom_6b4b2077819cf97fcf3d5b9a8ef8005f/node_modules/better-auth/dist/adapters/index.mjs [app-route] (ecmascript). Did you mean to import createAdapter? All exports of the module are statically known (It doesn't have dynamic exports). So it's known statically that the requested export doesn't exist. Import trace: App Route: ./node_modules/.pnpm/@convex-dev+better-auth@0.9_807d8382518d7307d7daede45ce7d913/node_modules/@convex-dev/better-auth/dist/esm/client/adapter.js ./node_modules/.pnpm/@convex-dev+better-auth@0.9_807d8382518d7307d7daede45ce7d913/node_modules/@convex-dev/better-auth/dist/esm/client/index.js ./node_modules/.pnpm/@convex-dev+better-auth@0.9_807d8382518d7307d7daede45ce7d913/node_modules/@convex-dev/better-auth/dist/esm/nextjs/index.js ./app/api/auth/[...all]/route.ts Next.js version: 16.0.0-beta.0 (Turbopack) How can I solve this?
Convex Integration | Better Auth
Integrate Better Auth with Convex.
No description
6 Replies
bekacru
bekacru3d ago
could you tell me which version of better auth you're on?
Chris
ChrisOP3d ago
pnpm add better-auth@1.3.8 --save-exact pnpm add convex@latest @convex-dev/better-auth I installed these packages from docs "dependencies": { "@convex-dev/better-auth": "^0.9.6", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-slot": "^1.2.3", "@react-email/render": "^1.3.2", "babel-plugin-react-compiler": "^1.0.0", "better-auth": "1.3.8", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "convex": "^1.28.0", "lucide-react": "^0.545.0", "next": "16.0.0-beta.0", "next-themes": "^0.4.6", "react": "19.1.0", "react-dom": "19.1.0", "resend": "^6.1.2", "tailwind-merge": "^3.3.1" }
Chris
ChrisOP3d ago
If can help I have also this error, i think is related.
No description
Chris
ChrisOP3d ago
I installed the beta version and the error disappeared
Chris
ChrisOP3d ago
No description
Chris
ChrisOP3d ago
Also this works: "better-auth": "1.3.27" From the Better Auth Docs: https://www.better-auth.com/docs/integrations/convex#set-environment-variables pnpm add better-auth@1.3.8 --save-exact pnpm add convex@latest @convex-dev/better-auth From Convex Docs: https://convex-better-auth.netlify.app/framework-guides/next pnpm add convex@latest @convex-dev/better-auth pnpm add better-auth@1.3.27 --save-exact
Next.js | Convex + Better Auth
Install and configure Convex + Better Auth for Next.js.
Convex Integration | Better Auth
Integrate Better Auth with Convex.

Did you find this page helpful?