Click-to-code does not work when command run from different directory
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 499
- Fork
- 100
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 4
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu trong packages/devtools-vite/src/inject-source.ts quanh dòng 259, nơi cwd được sử dụng để dọn dẹp đường dẫn id của Vite. Tái hiện vấn đề bằng ví dụ StackBlitz được liên kết, sử dụng một lệnh Vite từ thư mục khác với thư mục gốc của Vite, sau đó xác minh rằng click-to-code tạo ra một filePath không bị trùng lặp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- react, typescript, vite
- Lĩnh vực
- build-system, devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100