fix: properly handle Windows backslash paths in @fs imports#98
Conversation
On Windows, absolute file paths use backslashes (e.g. `D:\project\slides\index.tsx`). The current code only strips leading slashes for Unix paths but does not convert backslashes to forward slashes, which breaks Vite's `/@fs/` protocol on Windows. Before: `/@fs/D:\project\slides\index.tsx` (broken) After: `/@fs/D:/project/slides/index.tsx` (correct) This is a one-character fix: adding `.replace(/\\/g, '/')` after the existing `.replace(/^\/+/, '')` call. Fixes the "Failed to resolve import /@FSD:/..." error on Windows systems.
|
@jackyjjp is attempting to deploy a commit to the Yiwei Ho Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Vite plugin virtual module for ChangesPlatform Path Normalization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
On Windows, absolute file paths use backslashes (e.g.
D:\project\slides\index.tsx). The current code only strips leading slashes for Unix paths but does not convert backslashes to forward slashes, which breaks Vite's/@fs/protocol on Windows.Before:
/@fs/D:\project\slides\index.tsx(broken)After:
/@fs/D:/project/slides/index.tsx(correct)This is a one-character fix: adding
.replace(/\\/g, '/')after the existing.replace(/^\/+/, '')call.Fixes the "Failed to resolve import /@FSD:/..." error on Windows systems.
Summary by CodeRabbit