@nuxt/content forces prerender step and loads server/plugins
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- nuxt, typescript
- Domain
- backend
Research direction
The report identifies content.config.ts, nuxt.config.ts, and a plugin under server/plugins, but no internal @nuxt/content entry point or test. Start by tracing how the content module configures prerendering and compare builds with the module enabled and disabled using the provided reproduction. Done when the build does not force prerendering or initialize server plugins when prerendering is disabled.
Written by the indexing model from the issue text.
Description
Environment
| Operating system | Windows 10.0.26200 |
| CPU | Intel(R) Core(TM) [*redacted*] |
| Node.js version | v24.18.0 |
| nuxt/cli version | 3.35.2 |
| Package manager | [email protected] |
| Nuxt version | 4.4.6 |
| Nitro version | 2.13.4 |
| Builder | [email protected] |
| Config | alias, app, [*redacted*], compatibilityDate, css, devServer, devtools, experimental, i18n, modules, nitro, postcss, runtimeConfig, security, ssr, typescript, vite, vue |
| Modules | [*redacted*], @pinia/[email protected], @nuxtjs/[email protected], @nuxt/[email protected], [email protected] |
Version
v3.14.0
Reproduction
Repro:
- Configs
content.config.ts
import { defineContentConfig, defineCollection } from '@nuxt/content'
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**',
}),
},
})
nuxt.config.ts [redacted]
export default defineNuxtConfig({
compatibilityDate: "2025-07-15",
devtools: { enabled: true},
ssr: false,
experimental: {
viteEnvironmentApi: true,
},
nitro: {
routeRules: {
"/**": {
prerender: false
}
}
})
- Create a plugin under
server/pluginsthat relies on aruntimeConfig-mapped env var for its initialisation used insidedefineNitroPlugin - Run
nuxt buildin an environment where this env var is not defined
Expectation: no server/plugins are loaded
Actual behavior: server/plugins are loaded
Workaround: define all server-runtime vars in build-time environment
Actual solution: 1) do not force prerender phase, 2) do not try to load & initialize server/plugins during the prerender phase
I isolated in multiple runs that @nuxt/content is causing this
Description
@nuxt/content forces prerender step despite nuxt.config ssr: false, nitro.routeRules or routeRules explicitly disabling prerendering for all paths ('/**': { prerender: false }). For a reason unknown to me it tries to load nuxt server/plugins, using nuxt runtimeConfig-mapped env vars, which are not defined in the build/ prerender environment (CI/CD).
Additional context
No response
Logs
The following log shows an error occurring due to a missing runtimeConfig-mapped environment variable (passed to an openid-client based plugin in server/plugins) in the nuxt build environment:
ℹ ✓ built in 12.70s
ℹ vite v7.3.5 building ssr environment for production...
ℹ transforming...
ℹ ✓ 1 modules transformed.
ℹ rendering chunks...
ℹ ../node_modules/.cache/nuxt/.nuxt/dist/server/styles.mjs 0.07 kB
ℹ ../node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs 0.10 kB │ map: 0.36 kB
ℹ ✓ built in 47ms
[nitro] ℹ Initializing prerenderer
ERROR "clientSecret" must not be empty
at CodedTypeError (node_modules/.pnpm/[email protected]/node_modules/oauth4webapi/build/index.js:22:17)
at assertString (node_modules/.pnpm/[email protected]/node_modules/oauth4webapi/build/index.js:285:19)
at Module.ClientSecretBasic (node_modules/.pnpm/[email protected]/node_modules/oauth4webapi/build/index.js:484:5)
at ClientSecretBasic (node_modules/.pnpm/[email protected]/node_modules/openid-client/build/index.js:42:22)
[*redacted*]
when @nuxt/content is deactivated in nuxt.config.ts modules, no prerender step happens:
ℹ ✓ built in 11.00s
ℹ vite v7.3.5 building ssr environment for production...
ℹ transforming...
ℹ ✓ 1 modules transformed.
ℹ rendering chunks...
ℹ ../node_modules/.cache/nuxt/.nuxt/dist/server/styles.mjs 0.07 kB
ℹ ../node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs 0.10 kB │ map: 0.36 kB
ℹ ✓ built in 17ms
[nitro] ✔ Generated public .output/public
[nitro] ℹ Building Nuxt Nitro server (preset: node-server, compatibility date: 2025-07-15)
[nitro] ✔ Nuxt Nitro server built
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 746
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nuxt/content
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
defineGitSourceOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nuxt/content#3818 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nuxt/content#3813 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
D1: content upgrades fail when more than 100 documents are removed or changed (too many SQL variables)Possibly taken @zizzfizzix claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Cloudflare D1: Integrity check occasionally damages database without self-recoveryPossibly taken @zizzfizzix claimed this 6 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 38/100
nuxt/content#3854 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
bug priority: P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
mattermost/compass-design#106 ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openclaw/openclaw#176671 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
nordcraftengine/nordcraft#1400 ·
Maintainers usually reply within 1 day