Summary
Running pi-web on Windows currently requires two downstream patches that users on other platforms never need. If upstream natively supported Windows, both patches could be removed and every Windows user would benefit.
1. lib/directory-browser.ts serializes POSIX paths with the host path object
The directory browser selects the host-platform path object for serialized POSIX paths. On Windows this turns /Users/x into \\Users\\x, breaking POSIX path semantics.
Suggested fix: use path.posix for serialized/POSIX paths so the representation is stable regardless of host OS.
// before: `: path;` -> after: `: path.posix;`
2. Next.js outputFileTracingRoot not scoped to the package directory
When pi-web is embedded in an Electron/desktop wrapper, Next.js output tracing needs outputFileTracingRoot: __dirname so server externals resolve correctly. Without it, packaging fails or resolves wrong paths on Windows.
Value
- Removes two downstream patches.
- Improves Windows support for all users (path correctness + reliable packaging).
- Both are small, self-contained changes that are easy to review and test.
Environment
- pi-web 0.8.7 (issue reported from a Windows Electron wrapper)
- Node >= 22.19, Next.js 16
I can provide the exact diffs if useful.
Summary
Running pi-web on Windows currently requires two downstream patches that users on other platforms never need. If upstream natively supported Windows, both patches could be removed and every Windows user would benefit.
1.
lib/directory-browser.tsserializes POSIX paths with the hostpathobjectThe directory browser selects the host-platform
pathobject for serialized POSIX paths. On Windows this turns/Users/xinto\\Users\\x, breaking POSIX path semantics.Suggested fix: use
path.posixfor serialized/POSIX paths so the representation is stable regardless of host OS.// before: `: path;` -> after: `: path.posix;`2. Next.js
outputFileTracingRootnot scoped to the package directoryWhen pi-web is embedded in an Electron/desktop wrapper, Next.js output tracing needs
outputFileTracingRoot: __dirnameso server externals resolve correctly. Without it, packaging fails or resolves wrong paths on Windows.Value
Environment
I can provide the exact diffs if useful.