Skip to content

fix(static): respond with 404 when a public asset is missing on disk - #4787

Merged
pi0 merged 2 commits into
v2from
backport/static-enoent
Oct 15, 2026
Merged

pi0 merged 2 commits into
v2from
backport/static-enoent

Conversation

@pi0x

@pi0x pi0x commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Backports #4588 to v2. When a public asset listed in the build manifest is removed from disk after the build, the node reader threw ENOENT and the static handler answered 500 instead of 404 (nuxt/nuxt#29078, nuxt/nuxt#33033). The node readAsset now resolves empty on ENOENT, and the static handler responds 404 (dropping Cache-Control) when a reader returns no data. The change matches main, written with h3 v1 helpers; since v2 had no unit tests for these modules, the new tests drive the handler through toWebHandler and load the reader from nitro.vfs.

🤖 Generated with AI assistant

@pi0x
pi0x requested a review from pi0 as a code owner October 15, 2026 08:09
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nitro.build Ready Ready Preview Oct 15, 2026 8:18am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: adc6283f-7fb1-4dad-b820-08c8d28dfa52

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitropack@4787

commit: 9201a02

@pi0
pi0 merged commit d543fcc into v2 Oct 15, 2026
11 of 12 checks passed
@pi0
pi0 deleted the backport/static-enoent branch October 15, 2026 08:38

This branch was successfully deployed

1 active deployment
Preview — 9201a02e Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants