Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

@nuxt/content forces prerender step and loads server/plugins

Open
#3,870 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. 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
      }
  }
})
  1. Create a plugin under server/plugins that relies on a runtimeConfig-mapped env var for its initialisation used inside defineNitroPlugin
  2. Run nuxt build in 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nuxt/content

All issues in nuxt/content

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.