remib18
remib18
Explore posts from servers
BABetter Auth
Created by remib18 on 4/13/2025 in #bug-reports
advanced.generateId: false is ignored in 1.2.6 with drizzleAdapter
Hi everyone, After updating to v1.2.6, I've encountered a problem where better-auth is generating IDs, which conflicts with my database that relies on UUIDs. The issue seems most likely related to the drizzleAdapter, as similar problems appeared with the passkey and emailOTP plugins. I temporarily downgraded to v1.2.5 to avoid the error, which looks like this:
# SERVER_ERROR: [error: invalid input syntax for type uuid: "whFaJpiOdr2ppkZD4lOP19hsh08acoT2"] {
length: 164,
severity: 'ERROR',
code: '22P02',
...,
routine: 'string_to_uuid'
}
# SERVER_ERROR: [error: invalid input syntax for type uuid: "whFaJpiOdr2ppkZD4lOP19hsh08acoT2"] {
length: 164,
severity: 'ERROR',
code: '22P02',
...,
routine: 'string_to_uuid'
}
To reproduce:
Install better-auth@1.2.6 and use the following auth configuration (note that the issue is likely with drizzleAdapter):
export const auth = betterAuth({
appName: process.env.NAME,
database: drizzleAdapter(db, {
provider: "pg",
schema: schema
}),
advanced: {
generateId: false,
},
emailAndPassword: {
enabled: true,
password: {
verify: async (data) => true // For easier debugging
}
},
plugins: [
passkey({
rpID: process.env.RP_ID,
rpName: process.env.NAME,
origin: process.env.ORIGIN,
}),
emailOTP({
sendVerificationOnSignUp: false,
disableSignUp: true,
async sendVerificationOTP({ email, otp, type }) { /* ... */ },
}),
nextCookies()
],
});
export const auth = betterAuth({
appName: process.env.NAME,
database: drizzleAdapter(db, {
provider: "pg",
schema: schema
}),
advanced: {
generateId: false,
},
emailAndPassword: {
enabled: true,
password: {
verify: async (data) => true // For easier debugging
}
},
plugins: [
passkey({
rpID: process.env.RP_ID,
rpName: process.env.NAME,
origin: process.env.ORIGIN,
}),
emailOTP({
sendVerificationOnSignUp: false,
disableSignUp: true,
async sendVerificationOTP({ email, otp, type }) { /* ... */ },
}),
nextCookies()
],
});
Any guidance or fixes would be greatly appreciated. Thanks,
Rémi
10 replies
DDokploy
Created by remib18 on 8/13/2024 in #old-help
NextJS build issue
Hello ! I've been playing around with Dokploy to test its capabilities, and so far, I'm quite impressed. I'm currently building a test NextJS application. It was working fine after some trial and error, but suddenly, NextJS seems to be skipping the build process...
#12 [8/8] RUN pnpm run build
#12 5.335
#12 5.335 > urbex-next@0.1.0 build /app
#12 5.335 > next build
#12 12.22
#12 13.04 ▲ Next.js 14.2.5
#12 13.04 - Environments: .env
#12 13.04
#12 13.75 Creating an optimized production build ...
#12 DONE 34.4s

#13 exporting to image
#13 exporting layers
#13 exporting layers 5.9s done
#13 writing image sha256:5e66a251337e7956ca7a956018758b154f63984fff9e9d6519d5184c83e32272 0.0s done
#13 naming to docker.io/library/website-frontend-062bee
#13 naming to docker.io/library/website-frontend-062bee 0.2s done
#13 DONE 6.4s
Docker Deployed: ✅
#12 [8/8] RUN pnpm run build
#12 5.335
#12 5.335 > urbex-next@0.1.0 build /app
#12 5.335 > next build
#12 12.22
#12 13.04 ▲ Next.js 14.2.5
#12 13.04 - Environments: .env
#12 13.04
#12 13.75 Creating an optimized production build ...
#12 DONE 34.4s

#13 exporting to image
#13 exporting layers
#13 exporting layers 5.9s done
#13 writing image sha256:5e66a251337e7956ca7a956018758b154f63984fff9e9d6519d5184c83e32272 0.0s done
#13 naming to docker.io/library/website-frontend-062bee
#13 naming to docker.io/library/website-frontend-062bee 0.2s done
#13 DONE 6.4s
Docker Deployed: ✅
As a result, the next start command isn't working:
> next start

▲ Next.js 14.2.5
- Local: http://localhost:3000

✓ Starting...
Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at setupFsCheck (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-utils/filesystem.js:151:19)
at async initialize (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:61:23)
at async Server.<anonymous> (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:249:36)
 ELIFECYCLE  Command failed with exit code 1.
> next start

▲ Next.js 14.2.5
- Local: http://localhost:3000

✓ Starting...
Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at setupFsCheck (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-utils/filesystem.js:151:19)
at async initialize (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:61:23)
at async Server.<anonymous> (/app/node_modules/.pnpm/next@14.2.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:249:36)
 ELIFECYCLE  Command failed with exit code 1.
For reference, here's an example of the expected log output on my local machine: I've tried pruning all Docker volumes, images, containers, and build cache, but the issue persists. :/ Thanks in advance for your help!
19 replies