fix(nuxthub): register sql_dump route even if the database is disabled#3668
Merged
fix(nuxthub): register sql_dump route even if the database is disabled#3668
Conversation
|
@onmax is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
Member
|
Disabling pre-render is not the solution for the problem. When database is disabled, NuxtHub Preset does not call parent preset and therefore sql_dump route do not register. content/src/presets/nuxthub.ts Lines 15 to 18 in 7c07081 Do you mind updating your PR with: // file: src/presets/nuxthub.ts
if (nuxtOptions.hub?.db || nuxtOptions.hub?.database) {
const runtimeConfig = nuxt.options.runtimeConfig as unknown as { hub: { db?: boolean | { driver: string, connection: { url?: string } }, database?: boolean | { driver: string, connection: { url?: string } } } }
// Read from the final hub database configuration
const hubDb = runtimeConfig.hub.db || runtimeConfig.hub.database
// NuxtHub <= 0.9
if (nuxtOptions.hub?.database === true) {
options.database ||= { type: 'd1', bindingName: 'DB' }
}
else if (typeof nuxtOptions.hub?.db === 'string' && typeof hubDb === 'object') {
if (hubDb.driver === 'd1') {
options.database ||= { type: 'd1', bindingName: 'DB' }
}
else if (hubDb.driver === 'node-postgres') {
options.database ||= { type: 'postgresql', url: hubDb.connection.url as string }
}
else {
options.database ||= { type: hubDb.driver as 'sqlite' | 'postgresql' | 'postgres' | 'libsql' | 'pglite', ...hubDb.connection } as unknown as SqliteDatabaseConfig | LibSQLDatabaseConfig | PGliteDatabaseConfig
}
}
} else {
logger.warn('NuxtHub dedected but the database is not enabled. Using local SQLite as default database instead.')
return
}
|
Member
|
@luminous8 @onmax Do you mind testing with PR release |
Contributor
Author
|
Tested with Repro: https://github.com/onmax/repros/tree/main/nuxthub-754-fixed |
farnabaz
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3667
resolves #3666
Summary
sql_dump.txtroutes fail prerendering withcrawlLinks: truebecause handlers need cloudflare bindings (ASSETS) unavailable at build timeprerender.ignorepattern for these routes in cloudflare and node presetsStackBlitz
CLI Reproduction
Verify fix
The
-fixedfolder uses pnpm patch to apply the fix locally.Related
sql_dump.txtfrom Nuxt Content nuxt-hub/core#754