-
-
Notifications
You must be signed in to change notification settings - Fork 746
sql_dump.txt routes fail prerender with crawlLinks: true #3667
Copy link
Copy link
Closed
Description
Environment
- @nuxt/content: 3.10.0
- Preset: cloudflare-pages (non-static)
Describe the bug
When using nitro.prerender.crawlLinks: true, the /__nuxt_content/:collection/sql_dump.txt routes are discovered during prerendering and fail because the handler needs cloudflare bindings (ASSETS) that aren't available at build time.
Reproduction
https://stackblitz.com/edit/github-n1pcahgr
Or locally:
# nuxt.config.ts
nitro: { prerender: { routes: ['/'], crawlLinks: true } }Run npm run build with NITRO_PRESET=cloudflare-pages.
Expected behavior
The sql_dump.txt routes should be excluded from prerendering since they're API routes that need runtime bindings.
Related
Suggested fix
Add prerender.ignore for the sql_dump.txt routes in the cloudflare preset:
// src/presets/cloudflare.ts setupNitro
nitroConfig.prerender ||= {}
nitroConfig.prerender.ignore ||= []
nitroConfig.prerender.ignore.push(/^\/__nuxt_content\/.*\/sql_dump\.txt/)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels