Repository navigation
fix(dev): show cwd-relative paths in the error page on Windows - #4705
Conversation
`relativePath` compared frame paths with `process.cwd()` as plain strings. On Windows the cwd uses `\` while Vite reports module paths with `/`, so app frames in the dev error page and the terminal output kept their absolute `C:/...` path instead of `./server/...`. Compare with `/` separators when the cwd is a Windows path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@kaanisthatyou is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesRelative path handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Windows error paths can be shown relative to the working directory, while paths outside it remain unchanged. No merge-blocking issue is identified. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
🔗 Linked issue
No issue; found while running the new dev error page (#4699) on Windows.
❓ Type of change
📚 Description
On Windows, app frames in the dev error page and in the
[request error]terminal output keep their absolute path (C:/Users/me/app/server/routes/boom.ts:4:9) instead of./server/routes/boom.ts:4:9.relativePathcompares the frame path withprocess.cwd()as plain strings, but the cwd uses\while Vite reports module paths with/, so the prefix never matches. This PR compares with/separators when the cwd is a Windows path.The new unit test mocks
process.cwd()asC:\appand checks both separators; it fails onmain. In the playground on Windows with a throwing route,mainprintsat explode (C:/Users/.../playground/server/routes/boom.ts:4:9)and this branch printsat explode (./server/routes/boom.ts:4:9). The fourdev-error-rendertests that failed on Windows now pass.📝 Checklist