TanStack / TanStack/devtools

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

Abierto
#281 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
TypeScript
Estrellas
499
Forks
100
Merge medio
1 d 17 h
PR fusionados (30 d)
4

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza en packages/devtools-vite/src/inject-source.ts alrededor de la línea 259, donde se usa cwd para limpiar la ruta del id de Vite. Reproduce el problema con el ejemplo enlazado de StackBlitz usando un comando de Vite desde un directorio diferente de la raíz de Vite y, después, verifica que click-to-code produzca un filePath no duplicado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react, typescript, vite
Área
build-system, devtools
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.