Skip to content

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

Description

@dust617

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions