TanStack / TanStack/devtools

Click-to-code does not work when command run from different directory

Aperta
#281 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
TypeScript
Stelle
499
Fork
100
Merge medio
1g 17h
PR unite (30g)
4

Descrizione

TanStack Devtools version

0.3.11

Framework/Library version

React 19.2.0

Describe the bug and the steps to reproduce it

If the Vite command is run from a different directory than what the Vite root is (we do this because we have a big monorepo), the click-to-code feature does not work. When making a custom editor config, I can see that the filePath includes duplication of some parts of the path (/Users/literalpie/my-repo/config/Users/literalpie/my-repo/src/App.tsx)

I believe the problem is that cwd is used to clean up the path, but cwd might not match what's in the vite id path.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://stackblitz.com/edit/vitejs-vite-bvszfdfc?file=config%2Fvite.config.ts,README.md&terminal=dev

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia in packages/devtools-vite/src/inject-source.ts intorno alla riga 259, dove cwd viene usato per ripulire il percorso dell’id di Vite. Riproduci il problema con l’esempio StackBlitz collegato usando un comando Vite da una directory diversa dalla radice Vite, quindi verifica che click-to-code produca un filePath non duplicato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react, typescript, vite
Ambito
build-system, devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.