Skip to content

Desktop builds work on Windows: the native bundler handles backslash and drive-letter paths - #613

Merged
jonit-dev merged 1 commit into
developfrom
fix/native-bundler-windows-paths
Nov 5, 2026
Merged

jonit-dev merged 1 commit into
developfrom
fix/native-bundler-windows-paths

Conversation

@jonit-dev

Copy link
Copy Markdown
Contributor

What is this PR about?

threenative build --target desktop failed on Windows for every game. Linux was fine. Fixes #612.

Why does it matter?

The store's build farm builds windows-x64 on windows-latest. No ThreeNative game could ship a Windows build.

Root causes (both in packages/runtime-native/scripts/bundle-native-engine.mjs)

  1. The esbuild hooks matched importers with a / prefix (${player}/, ${core}/src/). esbuild gives Windows importers with \, so core's assets.js was not redirected to the player facade. Its loaders were then checked as game imports: TN_NATIVE_ENGINE_UNBOUND: …GLTFLoader…. Fix: path.sep.
  2. await import(assetsEntry) took a raw D:\… path. Node reads d: as a URL scheme and throws. Fix: pathToFileURL(assetsEntry).href.

Proof (real GitHub runners, same lockfile, the fix carried as a pnpm patch in threenative-store examples/fox-native)

Run https://github.com/ThreeNativeHQ/threenative-store/actions/runs/41960133277

⚠️ The engine CI has no Windows leg that runs the desktop bundler, so no test here locks the fix. A Windows smoke job for build --target desktop is the follow-up.

esbuild hands Windows importers with backslashes, so the '/' prefix checks missed core's
assets.js and bundled its loaders as game imports (TN_NATIVE_ENGINE_UNBOUND). The asset
compiler import took a raw D:\ path, which Node reads as a 'd:' URL scheme.
@jonit-dev
jonit-dev added this pull request to the merge queue Nov 5, 2026
Merged via the queue into develop with commit 1cb51d0 Nov 5, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant