Better AuthBA
Better Auth13mo ago
Dev

Error in signing up using cloudflare d1 database and drizzle orm on nextjs15

I've been trying to make the signup logic work, ive watch so 2 tutorials relating to the same techstack as mine and wrote same code as them but mine doesn't work at all gave same errors on all iterations.

this error occurs when i submit the sign-up form, i have nothing in the code defined as "fullSchema" :
 ERROR   TypeError Cannot read properties of undefined (reading 'fullSchema')                                                 Better Auth

  at y (.next\server\chunks\node_modules_better-auth_dist_37bdef._.js:5192:33)
  (... clipped)
  at async Server.requestListener (node_modules\next\dist\server\lib\start-server.js:146:13)

 POST /api/auth/sign-up/email?currentURL=http%3A%2F%2Flocalhost%3A3000%2Fregister 500 in 135ms


and this error appears in the browser console:
{
    "response": {},
    "request": {
        "baseURL": "http://localhost:3000/api/auth",
        "credentials": "include",
        "method": "POST",
        "plugins": [
            {
                "id": "redirect",
                "name": "Redirect",
                "hooks": {}
            },
            {
                "id": "add-current-url",
                "name": "Add current URL",
                "hooks": {}
            },
            {
                "id": "apply-schema",
                "name": "Apply Schema",
                "version": "1.0.0"
            }
        ],
        "body": "{\"name\":\"dev\",\"email\":\"dev@mail.com\",\"password\":\"qwerty1234\",\"callbackURL\":\"/verify-email\"}",
        "url": "http://localhost:3000/api/auth/sign-up/email?currentURL=http%3A%2F%2Flocalhost%3A3000%2Fsign-up",
        "headers": {},
        "signal": {}
    },
    "error": {
        "status": 500,
        "statusText": "Internal Server Error"
    }
}

versions:
"better-auth": "^1.0.22"
"next": "15.1.0"
"drizzle-orm": "^0.38.2"
"wrangler": "^3.98.0"

any help is appreciated!
Was this page helpful?