Skip to content

Prerendered index.html not served statically by Vercel preset — root URL goes through SSR function #4242

Closed

Description

@MaxMrt

Question

I'm running into the following behavior with the Vercel preset and wanted to ask whether this is a known issue, or whether
others have observed the same — before filing it as a bug.

Setup

A Nuxt 4 project (Nitro under the hood) deployed to Vercel, with:

routeRules: {
  '/': { prerender: true },
  '/foo/**': { prerender: true },
}

The build produces both .output/public/index.html and .output/public/foo/some-slug/index.html as expected.

What I observe

Detail routes are served as pure static files from the Vercel Edge CDN. Response headers include accept-ranges: bytes,
etag, last-modified, content-disposition — clear signs of CDN file delivery, no SSR function involved.

The root URL (/) on the same deploy behaves differently: it appears to be rendered by an SSR function on cache miss.
Headers include x-powered-by: Nuxt and cache-control: public, max-age=3600, and crucially do not include
accept-ranges / etag / last-modified.

curl -D - -o /dev/null https://<deployment>/
# x-powered-by: Nuxt
# cache-control: public, max-age=3600
# (no etag/accept-ranges/last-modified)

curl -D - -o /dev/null https://<deployment>/foo/some-slug
# accept-ranges: bytes
# etag: "..."
# last-modified: ...
# (no x-powered-by)

The first cache miss after deploy or after the 1h CDN cache expires therefore goes through a cold function start instead of
being delivered from the static file. Detail pages are not affected.

What seems to cause it

Looking at the generated .vercel/output/config.json, the overrides differ:

"overrides": {
  "index.html":               { "path": "" },
  "foo/some-slug/index.html": { "path": "foo/some-slug" }
}

The root override has "path": "" (empty string), while detail routes get a proper non-empty path. Combined with the later
route { "src": "/", "dest": "/index" }, requests to / fall through to the SSR function instead of being matched by the
filesystem handler.

This looks similar to nuxt/nuxt#14888 (closed 2022) which was fixed by #500 — possibly a regression?

Question

  • Has anyone else observed this on recent Nitro / Nuxt versions with the Vercel preset?
  • Is the empty path in the root override expected behavior, or does it indicate something is misconfigured on my end?
  • If others can reproduce, I'm happy to file this as a bug — but wanted to check first whether it's already known.

Activity

  1. changed the title [-]Is this a known issue? Prerendered `index.html` not served statically by Vercel preset — root URL goes through SSR function[/-] [+]Prerendered `index.html` not served statically by Vercel preset — root URL goes through SSR function[/+] on May 2, 2026
  2. pi0x commented on Sep 7, 2026

    @pi0x
    Contributor

    Does not happen on v3 — the vercel preset no longer writes the root overrides entry with an empty path or a / -> /index route; the generated config puts the filesystem handler first, so the prerendered index.html is served statically.

    Triaged with AI assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions