Skip to content

fix(client): load virtual files from /_vfs/ for Nitro v3 compatibility - #1132

Merged
antfu merged 1 commit into
mainfrom
fix/vfs-nitro-v3
Oct 21, 2026
Merged

antfu merged 1 commit into
mainfrom
fix/vfs-nitro-v3

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Fixes #1127

The Virtual Files tab stayed empty on Nuxt 5. Nitro v3 only serves /_vfs/** and no longer answers /_vfs.json. Nitro v2 only handled /_vfs.json because h3 v1 prefix-matches /_vfs. Both versions return JSON for /_vfs/ when the request has Accept: application/json. The client now requests that URL, so the tab works on Nitro v2 and v3.

Note: Nitro still lists entries[].path as /_vfs.json/<id>. The client does not use that field.


This PR was created with the help of an AI agent.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9c56896
Status: ✅  Deploy successful!
Preview URL: https://acd2177f.nuxt-devtools.pages.dev
Branch Preview URL: https://fix-vfs-nitro-v3.nuxt-devtools.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 38f2e750-68ea-47b8-9ac0-75bd1dac6eeb
📥 Commits

Reviewing files that changed from the base of the PR and between 5a12cef and 9c56896.

📒 Files selected for processing: 2
  • packages/devtools/client/composables/state.ts
  • packages/devtools/client/pages/modules/virtual-files.vue

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The virtual-file list request now uses /_vfs/ and sends an Accept: application/json header. Requests for individual virtual files now use /_vfs/<fileId> instead of /_vfs.json/<fileId>. JSON response handling remains in place.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9c568

The change addresses virtual-file loading compatibility without a remaining actionable merge risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the client change and its Nitro v3 compatibility purpose.
Description check Passed The description directly explains the Nitro v2 and v3 endpoint behavior, the client changes, and the issue being fixed.
Linked Issues check Passed Issue [#1127] requires the client to load virtual files from an endpoint supported by Nitro 3. useVirtualFiles now requests /_vfs/ with Accept: application/json, which matches the issue requirem…
Out of Scope Changes check Passed The diff changes only the virtual-file list and detail client URLs and the list request header. These changes directly support issue [#1127]. No unrelated source, API, or repository changes are presen…
Full details: Linked Issues check

Explanation

Issue [#1127] requires the client to load virtual files from an endpoint supported by Nitro 3. useVirtualFiles now requests /_vfs/ with Accept: application/json, which matches the issue requirement and preserves JSON parsing. The virtual-file detail request also changed from /_vfs.json/&lt;id&gt; to /_vfs/&lt;id&gt; with the JSON Accept header. No linked issue requires a Nitro route change.

Full details: Out of Scope Changes check

Explanation

The diff changes only the virtual-file list and detail client URLs and the list request header. These changes directly support issue [#1127]. No unrelated source, API, or repository changes are present in the reviewed diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.

@antfu
antfu merged commit e1f30a1 into main Oct 21, 2026
10 checks passed
@antfu
antfu deleted the fix/vfs-nitro-v3 branch October 21, 2026 09:32
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.

Virtual Files tab is empty on Nuxt 5 / Nitro 3: /_vfs.json returns 404

2 participants