Repository navigation
Desktop builds work on Windows: the native bundler handles backslash and drive-letter paths - #613
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
threenative build --target desktopfailed on Windows for every game. Linux was fine. Fixes #612.Why does it matter?
The store's build farm builds
windows-x64onwindows-latest. No ThreeNative game could ship a Windows build.Root causes (both in
packages/runtime-native/scripts/bundle-native-engine.mjs)/prefix (${player}/,${core}/src/). esbuild gives Windows importers with\, so core'sassets.jswas not redirected to the player facade. Its loaders were then checked as game imports:TN_NATIVE_ENGINE_UNBOUND: …GLTFLoader…. Fix:path.sep.await import(assetsEntry)took a rawD:\…path. Node readsd: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
windows-latest, without the fix: the Windows: threenative build --target desktop reports core's own loaders as unbound game imports #612TN_NATIVE_ENGINE_UNBOUNDerrors (red).windows-latest, with the fix:threenative build --target desktop --mode releasepasses, and the store's farm builder packs it (packed 7 files).ubuntu-latest, with the fix: no regression.build --target desktopis the follow-up.