Click-to-code does not work when command run from different directory
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 499
- Forks
- 100
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in packages/devtools-vite/src/inject-source.ts um Zeile 259, wo cwd verwendet wird, um den Vite-id-Pfad zu bereinigen. Reproduziere das Problem mit dem verknüpften StackBlitz-Beispiel, indem du einen Vite-Befehl aus einem anderen Verzeichnis als dem Vite-Root verwendest, und überprüfe anschließend, dass click-to-code einen nicht duplizierten filePath erzeugt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- react, typescript, vite
- Bereich
- build-system, devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100