Repository navigation
dsh plugin add promotes pre-existing bundle-declaring deps into the bundle stack and breaks the next boot with "duplicate loader entry id" #1404
Replies: 5 comments
|
Confirmed โ this is a real and distinct bug from #1377 (which I also verified). Here's the exact chain in master, plus why the duplicate-id crash happens. Source confirmation1.
for (const packageName of dependencies) {
const isBundle = exportsPatch(packageName, profileDir)
if (isBundle && !plugins.includes(packageName)) {
plugins.push(packageName)
changed = true
}
...
}This runs on every 2. The duplicate id comes from the user patch The boot sequence composes:
if (seen.has(id)) throw new TypeError(`duplicate loader entry id: ${id}`)3. Why This vs #1377
Both stem from the same root: Fix suggestions
The cleanest long-term fix is making the reconcile diff-aware (compare dependency changes since last invocation, like the second loop already does for removal via Want me to draft the diff-aware reconcile patch against |
|
Thanks for the thorough verification โ the source-level walkthrough (the promotion loop in I agree with your direction:
And yes โ if you draft the patch, I would be glad to test it. I still have the exact repro (profile with a bundle-declaring Since issues are disabled upstream, a PR is the right vehicle โ happy to help however that lands. |
|
#1728 ๅฏไปฅ่ชๅทฑๆPRๆถๅฝ ใ่ฎฐๅพไบ็ธ่ต่ตใ ไฝ ่ฟไธชๆบๅฅฝใ |
|
Hello maintainers, I am doing a small read-only research effort around a possible composition-causality diagnostic layer for Harness/Cordis. This is not a desktop UI, marketplace, generic Doctor, or runtime fork. I independently replayed the #1404 failure family in an isolated rc.7 environment:
I also replayed the #2035 root family. My fixture hit a prompt-section registration collision before the inspect-provider layer, so I am explicitly treating it as the same process-global registration family, not as an exact reproduction of the original registration layer. A thin deterministic Explain layer can currently use existing read-only evidence such as loader entries, reflect/provider identity, Fiber state/status, inventory state, and composition provenance to emit machine-readable owner/scope context. I would value maintainer guidance on three questions:
I am not claiming that the full HMR silent-disable lifecycle reported elsewhere has been reproduced; that remains mechanism-only in my isolated fixture. I will keep this effort thin and stop rather than build a large product if the layer is not useful or the surfaces are not intended for external use. |
Uh oh!
There was an error while loading. Please reload this page.
dsh plugin addpromotes pre-existing bundle-declaring deps into the bundle stack and breaks the next boot with "duplicate loader entry id"TL;DR (ไธญๆๆ่ฆ)
dsh plugin --profile web add <pkg>ๅฎ่ฃ ๆๅๅ๏ผไผๆๆๆๅฃฐๆไบdsh.bundle็ไพ่ต๏ผๅ ๆฌๆฌๆฌกๅฝไปคไนๅๅฐฑๅญๅจใไธ็ด้cordis.patch.ymlinsert ๅ ่ฝฝ็ๆไปถ๏ผ่ฟฝๅ ่ฟdsh.profile.bundlesใๅฆๆ็จๆท patch ้ไปไฟ็่ฟไบๆไปถ็ insert๏ผไธไธๆฌกๅฏๅจdsh webๆถ cordis loader ไผๅ ้ๅค entry id ็ดๆฅๅดฉๆบ๏ผdsh --profile web --dump-configๆฃๆตไธๅฐ่ฟไธช้ฎ้ข๏ผๅฎไธๆ่ฝฝ loader๏ผ๏ผๅชๆ็ๅฎๅฏๅจๆๆฅ้ใEnvironment
@deepseek-ai/dsh0.1.0-rc.6 (launched vianpx @deepseek-ai/dsh web)webSteps to reproduce
file:dependencies and loaded only through the user patch layer (profiles/<name>/cordis.patch.ymlinserts) โ e.g.dsh-better-sidebarand@liustack/modlens, whose packages do declare"dsh": { "bundle": { "patch": "./cordis.patch.yml" } }but are not indsh.profile.bundles.dsh plugin --profile web add dshmarket(any package triggers it).dsh webโ crash:duplicate loader entry id: better-sidebar(andmodlens).Root cause
dsh plugin(thereconcilePluginsstep inlib/plugin-*.js) reconcilesdsh.profile.bundlesagainst the installed state on every invocation: every dependency that resolves to a package declaringdsh.bundle.patchis appended to the bundle layer list. This is intentional (anupdateshould activate a package that gained the declaration in a newer version), but it also promotes pre-existing dependencies that were never bundle layers and were being loaded via user-patch inserts.The user's own patch layer (
cordis.patch.yml) is not reconciled: its now-redundantinsertentries remain, so the same entry id is inserted twice.cordis-plugin-loader'sEntryGroup.updatethrows on duplicate ids at mount time.--dump-confignever mounts the loader, so the duplicate is invisible there (verified: dump-config exits 0 with both duplicate rows present in the composed tree) โ the failure only appears on a real boot.Workaround (what fixed it)
Back up and edit
profiles/web/cordis.patch.yml: remove theinsertentries whose ids are now provided by bundle layers (in my casebetter-sidebarandmodlens); keep only the non-bundle inserts (@local/dsh-emoji-picker,@local/dsh-ui-customizer). Boot then succeeds.Suggested fixes (any would help)
.bakbackup) or fail with an actionable message naming the exact file and entries to remove.dsh --profile web --check, or make--dump-configdo a mount-only dry run) so duplicate ids surface before the user restarts.pnpmis missing,dsh pluginprints "pnpm not found on PATH โ install pnpm to manage profile plugins" but could suggest concrete commands (corepack enable pnpm/npm i -g pnpm); the dshmarket plugin already provisions pnpm this way.Note
dshmarket's one-click install also shells out to
dsh plugin --profile <name> add, so it inherits this behavior โ a user installing anything from the market can hit the same crash if their user patch contains inserts for bundle-declaring packages.All reactions