fix: resolve vite.config.ts alias path on native Windows without WSL #110

Merged
emmawong merged 1 commit from fix/vite-config-windows-path into main 2026-10-03 20:14:41 +00:00
Member

new URL("./src", import.meta.url).pathname produces a path with a leading slash before the drive letter on Windows (e.g. /C:/Users/...), which isn't a valid filesystem path outside WSL/Linux/macOS. This breaks the @ import alias and all @/... imports when running Vite directly via npx vite on native Windows, though it works fine under devenv (which runs through WSL) or on Mac/Linux. Switched to Node's fileURLToPath, which correctly handles Windows paths in all environments.

new URL("./src", import.meta.url).pathname produces a path with a leading slash before the drive letter on Windows (e.g. /C:/Users/...), which isn't a valid filesystem path outside WSL/Linux/macOS. This breaks the @ import alias and all @/... imports when running Vite directly via npx vite on native Windows, though it works fine under devenv (which runs through WSL) or on Mac/Linux. Switched to Node's fileURLToPath, which correctly handles Windows paths in all environments.
fix: resolve vite.config.ts alias path on native Windows without WSL
All checks were successful
kennel/build build succeeded
kennel/deploy deployment healthy
CI / check-openapi (pull_request) Successful in 6m0s
CI / check-1 (pull_request) Successful in 8m54s
CI / build (pull_request) Successful in 13m33s
CI / check (pull_request) Successful in 0s
PR size / size (pull_request) Successful in 4s
PR title / lint (pull_request) Successful in 0s
128840a908
Owner

Kennel Deployments

Torn down at 2026-10-03 20:14:42 UTC.

<!-- kennel-deployment --> ### Kennel Deployments Torn down at 2026-10-03 20:14:42 UTC.
emmawong approved these changes 2026-10-03 20:13:42 +00:00
emmawong left a comment

Looks good!

Looks good!
emmawong deleted branch fix/vite-config-windows-path 2026-10-03 20:14:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/housing!110
No description provided.