You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Content-Length mismatch on builds/meta: app manifest rewritten after Nitro indexes public assets (Vite env API) #36688
Nuxt 5 nightly with @nuxtjs/seo and some prerendered routes, then nuxt build.
node .output/server/index.mjs
curl -sD - -o meta.json http://localhost:3000/_nuxt/builds/meta/<id>.json: the content-length header is bigger than wc -c meta.json.
Describe the bug
Nitro Vite environment API enabled
Problem
With the Vite environment API, writeAppManifest("public") in @nuxt/nitro-server runs on both compiled and prerender:done. The prerender:done write happens after Nitro has generated its public asset manifest (sizes and etags). Any change another module makes to builds/meta/<id>.json or builds/latest.json in between is erased, but Nitro keeps the old size.
Example with nuxt-skew-protection (via @nuxtjs/seo), which adds a skewProtection field in nitro:build:public-assets:
File
Served content-length
Actual body
_nuxt/builds/meta/<id>.json
7301
7243
_nuxt/builds/latest.json
903
71
The file on disk is about 2 seconds newer than the mtime in the server's asset manifest.
Impact
The browser fails the request with net::ERR_CONTENT_LENGTH_MISMATCH, and Nuxt logs [NUXT_E5002]. _isPrerenderedInManifest() then returns false, so client navigation to routes prerendered only by crawling or nitro.prerender.routes skips _payload.json and renders empty. A full reload works.
Expected
Nuxt shouldn't rewrite public files after Nitro has indexed them. It could write the final manifest before the public asset manifest is generated, or skip the second write when nothing has changed.
Activity
danielroe commentedon Oct 25, 2026
this is a regression in srvx - I opened h3js/srvx#337 to solve, but it's also solved in #36671.