fix(directory-picker-native): run win32 dialog worker under plain node - #37
Open
takoyakiwhite wants to merge 1 commit into
Open
Conversation
The source-plane worker launched through `--import tsx/esm` with a Windows
absolute path, which Node's ESM loader misparses as an `e:` scheme URL and
rejects with ERR_UNSUPPORTED_ESM_URL_SCHEME before the first IPC message —
the UI then only sees "win32 folder dialog worker exited before reporting
a result". The worker's modules use only erasable TS syntax, so launch it
directly under Node's native type stripping (stable since 22.18, inside
the engines range) with no loader chain. Also switch the built/source arm
test to `pathname.endsWith('.ts')` so bundler query strings cannot
misclassify source modules as built, and pin the spawn args plus a real
dialog smoke against the source arm.
Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.
Summary
Fixes the Windows source-plane folder dialog failure reported in deepseek-ai/deepseek-harness discussions #154 / #197: the Web UI showed
win32 folder dialog worker exited before reporting a result.Root cause
packages/host/directory-picker-native/src/win32-dialog-host.tslaunched the source-plane worker as:With a loader registered via
--import, Node's ESM loader resolves the entry as a URL. On Windows, the absolute pathE:\...becomes ane:scheme URL and Node rejects it withERR_UNSUPPORTED_ESM_URL_SCHEMEbefore the worker posts its first IPC message, so the driver only surfaces its generic exit error. Packaged consumers were unaffected because they launch the builtworker.cjsunder plain node.CI also missed it: the built/source arm test used
import.meta.url.endsWith('.ts'), and under Vitest/Vite the URL carries a query string, so the win32 smoke test silently exercised the built arm.Change
^22.19.0 || >=24.0.0). The worker's three modules use only erasable TS syntax, so no tsx bootstrap is needed — this does not conflict with the CLI source graph's tsx decision.new URL(import.meta.url).pathname.endsWith('.ts')so bundler query strings cannot misclassify source modules as built.--import) and the real-dialog win32 smoke now covers the source arm.tsxdevDependency from the package.Verification
packages/host/directory-picker-nativesuite: 48 passed, 1 skipped (win32-skipped built-worker e2e).pnpm run typecheckpasses.