NUXT_AUTH_NO_DATABASE_PROVIDER: No database provider is enabled
[NUXT_AUTH_NO_DATABASE_PROVIDER] No database provider is enabled.
Why this happens
The better-auth:database:providers hook left no enabled provider in the registry. The module normally registers a fallback provider named none, so this error usually follows a custom module that removes or disables the defaults. It does not mean every app must use NuxtHub.
How to fix it
Register an enabled provider with the better-auth:database:providers hook.
If you only want to use your own Better Auth adapter, keep the default provider registry and configure database in defineServerAuth().
If your module intentionally replaces the registry, it must leave an enabled provider. A minimal provider that delegates database configuration to the user's auth config is:
import { defineNuxtModule } from '@nuxt/kit'
export default defineNuxtModule({
setup(_options, nuxt) {
nuxt.hook('better-auth:database:providers', (providers) => {
providers.none = {
priority: 0,
buildDatabaseCode: () => 'export function createDatabase() { return undefined }',
}
})
},
})
Verify the fix
Run pnpm exec nuxt prepare, then confirm that your auth config still uses the intended database adapter.
See Use a custom database or return to the error reference.