Describe the bug
Cannot use postgre in local with DATABASE_URL variable in .env, im getting a "Binding not found" issue, while when i use "POSTGRES" instead of DATABASE_URL, it works
Im getting this error
✔ Nuxt Nitro server built in 1448ms nitro 2:14:37 PM
ℹ Vite server warmed up in 0ms 2:14:37 PM
ℹ Vite client warmed up in 1ms 2:14:37 PM
[nuxt:hub] ERROR Failed to create migrations table 2:14:38 PM
POSTGRES binding not found
ERROR [request error] [unhandled] [GET] http://localhost:3066/api/_auth/session 2:14:44 PM
ℹ Error: POSTGRES binding not found
⁃ at getDb (.nuxt/hub/db.mjs:8:28)
3 ┃
4 ┃ let _db
5 ┃ function getDb() {
6 ┃ if (!_db) {
7 ┃ const hyperdrive = process.env.POSTGRES || globalThis.__env__?.POSTGRES || globalThis.POSTGRES
❯ 8 ┃ if (!hyperdrive) throw new Error('POSTGRES binding not found')
9 ┃ _db = drizzle({ connection: hyperdrive.connectionString, schema })
10 ┃ }
11 ┃ return _db
12 ┃ }
13 ┃ const db = new Proxy({}, { get(_, prop) { return getDb()[prop] } })
⁃ at Object.get (.nuxt/hub/db.mjs:13:50)
⁃ (server/plugins/session.ts:15:0)
⁃ (node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:55:57)
⁃ (node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:55:47)
⁃ at parallelTaskCaller (node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:55:28)
⁃ at Hookable.callHookWith (node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:198:20)
⁃ at Hookable.callHookParallel (node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:191:17)
⁃ at Object.handler (node_modules/.pnpm/[email protected][email protected]/node_modules/nuxt-auth-utils/dist/runtime/server/api/session.get.js:6:23)
[CAUSE]
Error {
stack: 'POSTGRES binding not found\n' +
'at getDb (./.nuxt/hub/db.mjs:8:28)\n' +
'at Object.get (./.nuxt/hub/db.mjs:13:50)\n' +
'at ./server/plugins/session.ts:15:0)\n' +
'at ./node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:55:57)\n' +
'at ./node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:55:47)\n' +
'at parallelTaskCaller (./node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:55:28)\n' +
'at Hookable.callHookWith (./node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:198:20)\n' +
'at Hookable.callHookParallel (./node_modules/.pnpm/[email protected]/node_modules/hookable/dist/index.mjs:191:17)\n' +
'at Object.handler (./n'... 129 more characters,
message: 'POSTGRES binding not found',
}
ERROR [request error] [unhandled] [GET] http://localhost:3066/api/_auth/session 2:14:44 PM
.env
DATABASE_URL="postgresql://[email protected]/mydb"
nuxt config
hub: {
db: 'postgresql',
blob: true
},
my project info
- Operating System: `Darwin`
- Node Version: `v22.14.0`
- Nuxt Version: `4.2.1`
- CLI Version: `3.30.0`
- Nitro Version: `2.12.9`
- Package Manager: `[email protected]`
- Builder: `-`
- User Config: `modules`, `devtools`, `css`, `runtimeConfig`, `compatibilityDate`, `i18n`, `hub`, `nitro`, `vite`
- Runtime Modules: `@nuxt/[email protected]`, `@nuxthub/[email protected]`, `[email protected]`, `@polar-sh/[email protected]`, `@nuxtjs/[email protected]`
- Build Modules: `-`
Describe the bug
Cannot use postgre in local with DATABASE_URL variable in .env, im getting a "Binding not found" issue, while when i use "POSTGRES" instead of DATABASE_URL, it works
.env
DATABASE_URL="postgresql://[email protected]/mydb"nuxt config
my project info