pi-web icon indicating copy to clipboard operation
pi-web copied to clipboard

[Windows] directory-browser path.posix serialization + Next.js build tracing isolation force two downstream patches

Open dust617 opened this issue 3 months ago • 1 comments

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.

dust617 avatar Aug 06 '26 20:08 dust617

fixed in 6960b2a13bb3424f60f60a9bd8693b76eecf43d8

agegr avatar Aug 11 '26 16:08 agegr