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

Fechada
#1,127 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Um pull request relacionado já foi integrado.

  • #1132 de @antfubot — integrado

Avaliação

Dificuldade
3/5
Tempo estimado
Meio dia
Facilidade para iniciantes
42/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
nuxtjs, typescript, vite
Domínio
devtools, web-dev

Direção de pesquisa

Start with the request path: the client fetch of /_vfs.json in the published @nuxt/devtools-assets utils bundle, and the dev-server route app.get("/_vfs/**", createVFSHandler(...)) in nitro/dist/_dev.mjs. Reproduce by hitting /_vfs/ with Accept: application/json on a running nuxt dev server. Done means the Virtual Files tab lists entries again; the issue leaves open whether the fix belongs in DevTools or Nitro, so confirm the side with maintainers first.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Environment
  • @nuxt/devtools 4.0.0-beta.5 (@nuxt/devtools-assets 4.0.0-beta.5)
  • nuxt 5.0.0-2610121449-e69fd4e (nuxt-nightly@5x)
  • nitro 3.0.260903-beta
  • Vite 8.3.4, Node.js 26.11.1, Windows 11
Reproduction
  1. Nuxt 5 nightly app with @nuxt/devtools 4 beta, nuxt dev
  2. Open DevTools, authorize the browser, open the "Virtual Files" tab
  3. The tab stays empty; the dev server logs GET /_vfs.json 404
Cause (as far as I can tell)

The client fetches the file list from /_vfs.json (published bundle: @nuxt/devtools-assets/dist/_nuxt/utils-k1kpr21p.js, $fetch('/_vfs.json', { baseURL: '/', responseType: 'json' })).

Nitro 3's dev server only registers app.get("/_vfs/**", createVFSHandler(this.nitro)) (nitro/dist/_dev.mjs). Checked with curl against the running dev server:

Request Status
GET /_vfs.json 404
GET /_vfs.json/<id> 404
GET /_vfs/ with Accept: application/json 200, JSON (rootDir, entries, current)
GET /_vfs/.json 200, JSON
GET /_vfs/<id> with Accept: application/json 200, JSON

Note that the JSON returned by Nitro 3 still lists entries[].path as /_vfs.json/<id>, which 404s as well. So this could be fixed on either side: DevTools requesting /_vfs/ with Accept: application/json (or /_vfs/.json), or Nitro registering the /_vfs.json/** route again. Happy to open the issue at nitrojs/nitro instead if that is the better place.

Linguagem predominante
TypeScript
Estrelas
3.3k
Forks
222
Merge médio
1d 8h
PRs com merge (30d)
35

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de nuxt/devtools

Todas as issues de nuxt/devtools

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.