Click-to-code does not work when command run from different directory
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 499
- フォーク
- 100
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 4
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
packages/devtools-vite/src/inject-source.ts の259行目付近、cwd を使用して Vite の id パスをクリーンアップしている箇所から始めます。Vite のルートとは異なるディレクトリから Vite コマンドを使って、リンクされた StackBlitz の例で問題を再現し、その後 click-to-code が重複していない filePath を生成することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript, vite
- 領域
- build-system, devtools
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100