[Bug] Windows + npm global install: dsh web cannot boot — duplicate physical copies of @deepseek-ai/dsh-win32-process trigger koffi "Duplicate type name 'DSH_STARTUPINFOW'", and a create-then-check HMR race exits right after printing the URL #7593
Van1145141919810
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows 11 with a standard npm global install,
@deepseek-ai/dsh@0.1.5-rc.2cannot startdsh webout of the box. There are two independent defects; fixing either one alone is not enough:@deepseek-ai/dsh-win32-processin the npm-expanded tree. Two copies are evaluated in the same boot and both register the same koffi type on the same koffi instance, so koffi throwsDuplicate type name 'DSH_STARTUPINFOW';@deepseek-ai/dsh-sandbox-localthen fails to import and the plugin tree fails to load.runProfilecreates the HMR service dynamically and immediately checks it synchronously, whileHmr extends Serviceonly becomes visible after its asyncService.init. The process then throwsrequires the Cordis HMR serviceand exits.Both reproduce with zero third-party plugins: defect 2 on a brand-new empty
DSH_HOME(stock web profile), defect 1 on three clean re-installs.Environment
hoistedinstall strategy)@deepseek-ai/dsh@0.1.5-rc.2; its dependencies (dsh-base,dsh-app-boot,dsh-sandbox-*,dsh-win32-process, …) resolved to0.1.5-rc.3npm install -g @deepseek-ai/dsh@0.1.5-rc.2Defect 1 — duplicate
dsh-win32-process→ koffi duplicate typeSymptom (unmodified profile):
Variant (when the
sandboxentry is disabled):@deepseek-ai/dsh-permission-presets: pending (waiting for service: shell)— same root cause.Direct evidence:
require.resolve('@deepseek-ai/dsh-sandbox-local')succeeds, but a realimport()throws:dsh-win32-process/lib/index.js:35registers the type unconditionally at module top level:Root cause: after
npm install -g, the tree contains 4 physical copies of@deepseek-ai/dsh-win32-process@0.1.5-rc.3(byte-identical, different inodes):Two of them —
dsh-subprocess-local(provides thesubprocessservice) anddsh-sandbox-windows-acl(loaded bydsh-sandbox-local) — are evaluated in the same boot, and bothimportthe same koffi copy (there is only one koffi in the tree). The module is therefore evaluated twice and the same type name is registered twice on one koffi instance.This is not a dirty environment: full uninstall (
npm uninstall -g+ removing%APPDATA%\npm\node_modules\@deepseek-ai) +npm cache clean --force+ fresh install reproduced the identical 4-copy shape 3 times.npm install --package-lock-onlyresolves to a tree with a single copy, so this is npm's reify placement interacting with the package graph; the same install emits roughly 280npm warn ERESOLVE overriding peer dependency. At least 23 other packages are also duplicated (e.g.dsh-anonymous-user-id×4,debug×8).Impact: any Windows user who installs 0.1.5-rc.2 / rc.3 globally with npm and has a profile containing
sandbox(the base default) hits this;dsh webis completely unusable. macOS/Linux are unaffected (they usedsh-bash-sandboxand never load the pwsh/ACL/win32-process chain).Suggested fixes (any one suffices):
dsh-sandbox-windows-acl/dsh-subprocess-localconsumedsh-win32-processthroughpeerDependencies, so only one copy is placed.Defect 2 — HMR create-then-check race
After working around defect 1:
The plugin tree loaded and the web server is up — then the process kills itself. 3 of 3 attempts.
Minimal reproduction (stock profile, no third-party plugins):
Code path (
dsh/lib/profile-boot-*.js:321-333):and
dsh-app-boot/lib/index.js:1112hard-fails:Hmr extends Service; the service only becomes visible afterasync *[Service.init]()(cordis-plugin-hmr/lib/index.js:179+) completes itsrealpath+loadDependencies+ chokidarwatch.loader.create()returns while the fiber is stillLOADING, so the immediately following synchronous check must lose the race.patchReload: "live"is the default in the official web template, so this is the default path.Suggested fixes:
ctx.inject(['hmr'], …), or await the created fiber) — orhmrentry that already exists in base (it isdisabled: trueby default) for official profiles withpatchReload: "live"(we verified this works) — and/orOther observations
@latestproduces a mixed tree: CLI0.1.5-rc.2with dependencies at0.1.5-rc.3. Pinning exactly would make reports far easier to triage.plugin(s) failed to load: @deepseek-ai/dsh-sandbox-local … (see the error(s) logged above)— but nothing is logged above; the real koffi error is swallowed. Surfacing the underlying import exception on stderr would save a lot of time.--legacy-peer-depsis not a workaround: it removes the duplicates but skips peers, so@deepseek-ai/cordis-plugin-groupand others go missing anddsh --versionfails withERR_MODULE_NOT_FOUND.Local workarounds we are using (workarounds, not fixes)
npm install -gof dsh.hmrentry in the profile patch layer (disabled: false) so the boot flow waits for the service instead of racing it.Related reports already checked
--expose-internals is required for HMR service) on macOS arm64 and headless.npx dsh-win32 doctor --jsonreports all-pass on this machine; itskofficheck is profile-scoped ("no koffi found in any profile"), so it does not cover duplicated copies inside the global npm tree.npx dsh-fix doctor/disable sandboxwere tried and did not help (disablingsandboxturns the failure into a misleadingpermission-presets: pending (waiting for service: shell)).Requests
dsh doctor-style self-check that can detect "the same package is present as multiple physical copies" and "a native addon type was registered twice".--install-strategy?) and/or a known-good fallback version.中文摘要
Windows 11 + npm 全局安装的
@deepseek-ai/dsh@0.1.5-rc.2开箱即无法启动dsh web,两个独立缺陷:(A) npm 展开后的依赖树里@deepseek-ai/dsh-win32-process有 4 份实体副本,其中两份在同一次启动被求值,却在同一个 koffi 实例上重复注册类型DSH_STARTUPINFOW→dsh-sandbox-local导入失败 → 插件树加载失败;(B) 插件树加载完、URL 打印后,runProfile动态创建 HMR 服务并立即同步检查,而 HMR 的服务可见性要等异步Service.init→ 抛requires the Cordis HMR service后进程退出。两者在零第三方插件环境下均可复现(B 在全新空DSH_HOME的官方 profile 上 3/3 必现;A 在 3 次干净重装后形态一致)。macOS/Linux 不受 A 影响。All reactions