Additional fields, FAILED_TO_CREATE_USER

I have a issue, I have some custom fields and I want to pass them on user creation, but seems to get FAILED_TO_CREATE_USER, with no details more about the error.
8 Replies
Scai
ScaiOP2w ago
@Better Auth Do you know anything about this?
Better Auth
Better Auth2w ago
Hi there! Yes, I'm familiar with Better Auth. It's a comprehensive authentication framework for TypeScript that supports a wide range of features—from built-in email and password authentication (with functionalities like email verification and password reset [1], [5]) to social sign-on, multi-factor authentication, and even single sign-on via plugins [12], [15]. It’s designed to be framework agnostic, working seamlessly with popular frameworks like React, Vue, and more [7], [15]. Could you clarify which specific part you're interested in? Sources: [1] Email | Better Auth [5] Options | Better Auth [7] Introduction | Better Auth [12] Single Sign-On (SSO) | Better Auth [15] Better Auth
Scai
ScaiOP2w ago
@Better Auth I have a issue, I have some custom fields and I want to pass them on user creation, but seems to get FAILED_TO_CREATE_USER, with no details more about the error.
Better Auth
Better Auth2w ago
It sounds like your custom fields aren’t being correctly reflected in your database. This “FAILED_TO_CREATE_USER” error often occurs when the additional fields you’ve defined in your Better Auth configuration don’t actually exist (or don’t match) in your database schema. For example, if you add a custom field (like a business ID or marketingCommunicationAccepted) in your auth config, you must update your database schema accordingly and re-run the CLI generator (using something like "npx @better-auth/cli generate") so that the changes get applied [1]. Double-check that: - Your additionalFields configuration exactly matches the columns in your users (or relevant) table. - You’ve re-generated and migrated your database schema after adding the extra fields. - The payload in your signup API call includes these fields correctly. If everything is aligned and the issue persists, you might also want to verify that there are no type mismatches between your custom field definitions and the underlying database columns. Let me know if you have any other questions! Sources: [1] Adding additional fields to users table throws an error when signing up
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
Adding additional fields to users table throws an error when signin...
Package Versions better-auth:1.2.7 drizzle-orm:0.43.1 Schema export const customers = pgTable("customers", { id: text('id').primaryKey(), name: text('name').notNull(), ema...
Scai
ScaiOP2w ago
@Better Auth 2025-08-21T08:45:58.529Z ERROR [Better Auth]: Failed to create user [TypeError: SQLite3 can only bind numbers, strings, bigints, buffers, and null]
Better Auth
Better Auth2w ago
Hi there! This error is typically triggered when a field value isn’t being transformed into one of SQLite’s accepted types. In your case, it seems that the Kysely adapter isn’t correctly handling a renamed field—likely the transformation of a Date value (for example, renaming “expiresAt” to “expires_at”) is causing the issue to pass a Date instead of a string or number [1]. A good workaround is to verify that your field mapping and transformation logic convert Date objects into a proper format before sending them to SQLite. If you continue to encounter this error, checking for an updated patch or filing a bug report might also help. Let me know if you need more details on how to adjust your configuration! Sources: [1] [Kysely] Renamed model or field causes query error with SQLite
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
[Kysely] Renamed model or field causes query error with SQLite · I...
Is this suited for github? Yes, this is suited for github To Reproduce Rename verification field expiresAt to "expires_at" Add passkey via authClient.passkey.addPasskey(...) Current vs. E...
Scai
ScaiOP2w ago
@Better Auth Are you Dosu behind?
Better Auth
Better Auth2w ago
Hi there! I'm not Dosu—I'm Better Auth, your friendly bot here to help answer any questions you might have about Better Auth, the comprehensive authentication framework for TypeScript [1]. Let me know if you have any questions about its features, best practices, or anything else related to Better Auth! Sources: [1] remove dead code
GitHub
Build software better, together
GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.
From An unknown user
From An unknown user
From An unknown user
GitHub
remove dead code by arlyon · Pull Request #1989 · better-auth/bet...
A recent change left a variable behind which means an extra DB call 4ba4ade

Did you find this page helpful?