Error: column "displayUsername" of relation "users" does not exist in better-auth 1.3.6

- I am getting the following error when I try to update a username in better-auth from a sveltekit client
# SERVER_ERROR: error: column "displayUsername" of relation "users" does not exist
at /Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/pg/lib/client.js:545:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async PostgresConnection.executeQuery (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/kysely/dist/cjs/dialect/postgres/postgres-driver.js:93:49)
...
at async Object.update (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/better-auth/dist/shared/better-auth.DzBLnNed.cjs:463:19) {
length: 135,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '37',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'analyze.c',
line: '2536',
routine: 'transformUpdateTargetList'
}
# SERVER_ERROR: error: column "displayUsername" of relation "users" does not exist
at /Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/pg/lib/client.js:545:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async PostgresConnection.executeQuery (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/kysely/dist/cjs/dialect/postgres/postgres-driver.js:93:49)
...
at async Object.update (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/better-auth/dist/shared/better-auth.DzBLnNed.cjs:463:19) {
length: 135,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '37',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'analyze.c',
line: '2536',
routine: 'transformUpdateTargetList'
}
Cannot post full question here due to discord limitations BUT HERE IS THE FULL QUESTION
Stack Overflow
Error: column "displayUsername" of relation "users" does not exist ...
I am getting the following error when I try to update a username in better-auth from a sveltekit client SERVER_ERROR: error: column "displayUsername" of relation "users" doe...
7 Replies
tacit_danger
tacit_dangerOP3mo ago
"dependencies": {
"@better-fetch/fetch": "^1.1.18",
"better-auth": "^1.3.6"
}
"dependencies": {
"@better-fetch/fetch": "^1.1.18",
"better-auth": "^1.3.6"
}
-sveltekit client package.json
"dependencies": {
"@dotenvx/dotenvx": "1.48.3",
"bcryptjs": "^3.0.2",
"better-auth": "^1.3.4",
"bullmq": "^5.56.8",
"cors": "2.8.5",
"express": "4.21.2",
"helmet": "8.1.0",
"http-terminator": "3.2.0",
"ioredis": "5.6.1",
"pg": "^8.16.3",
"pg-promise": "11.15.0",
"pino": "9.7.0",
"pino-http": "10.5.0"
},
"dependencies": {
"@dotenvx/dotenvx": "1.48.3",
"bcryptjs": "^3.0.2",
"better-auth": "^1.3.4",
"bullmq": "^5.56.8",
"cors": "2.8.5",
"express": "4.21.2",
"helmet": "8.1.0",
"http-terminator": "3.2.0",
"ioredis": "5.6.1",
"pg": "^8.16.3",
"pg-promise": "11.15.0",
"pino": "9.7.0",
"pino-http": "10.5.0"
},
- express server package.json - oh shit wait a second, they are not using the same dependency on both sides, damn! let me test updating it on the server side and see if i still get the issue
# SERVER_ERROR: error: syntax error at or near "where"
at /Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/pg/lib/client.js:545:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async PostgresConnection.executeQuery (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/kysely/dist/cjs/dialect/postgres/postgres-driver.js:93:49)
at async
...
at async Object.update (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/better-auth/dist/shared/better-auth.DzBLnNed.cjs:463:19) {
length: 94,
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '21',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'scan.l',
line: '1248',
routine: 'scanner_yyerror'
}
# SERVER_ERROR: error: syntax error at or near "where"
at /Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/pg/lib/client.js:545:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async PostgresConnection.executeQuery (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/kysely/dist/cjs/dialect/postgres/postgres-driver.js:93:49)
at async
...
at async Object.update (/Users/vr/Desktop/code/ch_NEXT/ch_api/node_modules/better-auth/dist/shared/better-auth.DzBLnNed.cjs:463:19) {
length: 94,
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '21',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'scan.l',
line: '1248',
routine: 'scanner_yyerror'
}
congratulations people, the error message has changed - Upgraded both sveltekit frontend and express backend to use better-auth 1.3.7, still getting the same error
# SERVER_ERROR: error: column "displayUsername" of relation "users" does not exist
at /Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/pg/lib/client.js:545:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async PostgresConnection.executeQuery (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/kysely/dist/cjs/dialect/postgres/postgres-driver.js:93:49)
at async /Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/kysely/dist/cjs/query-executor/query-executor-base.js:37:28
...
at async UpdateQueryBuilder.executeTakeFirst (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/kysely/dist/cjs/query-builder/update-query-builder.js:477:26)
at async withReturning (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/better-auth/dist/shared/better-auth.Bm_lsK_X.cjs:119:13)
at async Object.update (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/better-auth/dist/shared/better-auth.Bm_lsK_X.cjs:265:16)
at async Object.update (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/better-auth/dist/shared/better-auth.DzBLnNed.cjs:463:19) {
length: 135,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '37',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'analyze.c',
line: '2536',
routine: 'transformUpdateTargetList'
}
# SERVER_ERROR: error: column "displayUsername" of relation "users" does not exist
at /Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/pg/lib/client.js:545:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async PostgresConnection.executeQuery (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/kysely/dist/cjs/dialect/postgres/postgres-driver.js:93:49)
at async /Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/kysely/dist/cjs/query-executor/query-executor-base.js:37:28
...
at async UpdateQueryBuilder.executeTakeFirst (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/kysely/dist/cjs/query-builder/update-query-builder.js:477:26)
at async withReturning (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/better-auth/dist/shared/better-auth.Bm_lsK_X.cjs:119:13)
at async Object.update (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/better-auth/dist/shared/better-auth.Bm_lsK_X.cjs:265:16)
at async Object.update (/Users/vr/Desktop/code/INCOMPLETE/ch_api/node_modules/better-auth/dist/shared/better-auth.DzBLnNed.cjs:463:19) {
length: 135,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '37',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'analyze.c',
line: '2536',
routine: 'transformUpdateTargetList'
}
tacit_danger
tacit_dangerOP3mo ago
accounts table
No description
tacit_danger
tacit_dangerOP3mo ago
sessions table
No description
tacit_danger
tacit_dangerOP3mo ago
users table
No description
tacit_danger
tacit_dangerOP3mo ago
verifications table
No description
tacit_danger
tacit_dangerOP3mo ago
displayName: "display_name" is clearly mapped to the config in src/lib/auth.ts you cant say the column doesnt exist when infact it does what am I supposed to do? i dont want to rename the postgres column displayUsername because that is against postgres naming conventions using uppercase letters like that i am already using the latest version of better-auth 1.3.7 anyone knows how to PATCH THE PLUGIN?
tacit_danger
tacit_dangerOP3mo ago
No description

Did you find this page helpful?