[Bug] plugin install reports success but silently disables an unresolved profile bundle #1377
Replies: 3 comments
|
Great report — I reproduced your exact scenario against the current master source and the mechanism is confirmed. Here's the precise chain: Source confirmation1.
2.
function exportsPatch(packageName: string, profileDir: string): boolean {
let dir: string
try {
dir = resolveBundleDir(NAME, packageName, INSTALL_ANCHOR, profileDir)
} catch {
return false // pnpm reported success yet the package is unresolvable — treat as plain
}
const manifest = readProfileManifest(NAME, dir)
return manifest.dsh?.bundle?.patch !== undefined
}3.
for (const packageName of [...plugins]) {
const wasDependency = beforeDeps.has(packageName) || dependencySet.has(packageName)
const stillBundle = dependencySet.has(packageName) && exportsPatch(packageName, profileDir)
if (wasDependency && !stillBundle) {
plugins.splice(plugins.indexOf(packageName), 1)
changed = true
}
}In your scenario: the package IS in Why "Already up to date" + silent disable is so insidious
The root design tension is in
Fix suggestions (aligned with your acceptance criteria)
This also deserves a note that a stale Want me to draft a concrete patch against |
|
package.json 声明了但 node_modules/lock 缺失 → install 报成功却静默禁用——这正是第 3 章"依赖解析"坑的又一形态(rc 期 pnpm-lock 与声明不同步)。 排查:install 后核对 pnpm-lock.yaml 是否含该包 + 看插件树是否 active。完整坑位见:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/03-profiles.md |
|
这个「报成功但实际没装上」的静默失败,我们实测目录时也踩过类似坑,常见的静默失败有两类:
排查时先 看它到底在不在依赖里,再 看有没有进配置树。这些坑我都整理在排错页了:https://dshbase.com/troubleshooting/ |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When a profile dependency is declared in
package.jsonbut missing fromnode_modulesandpnpm-lock.yaml,dsh plugin --profile web installcan report success without restoring it. DSH then silently removes the unresolved package fromdsh.profile.bundles, leaving the profile in a misleading and inconsistent state.Environment
@deepseek-ai/dsh0.1.0-rc.6webReproduction
{ "dependencies": { "@linxin666/dsh-web-ui-all": "0.1.12" }, "dsh": { "profile": { "bundles": ["@linxin666/dsh-web-ui-all"] } } }node_modulesandpnpm-lock.yaml.dsh web. It fails withdsh: cannot resolve profile bundle "@linxin666/dsh-web-ui-all".dsh plugin --profile web install.Already up to dateand exits successfully, but the package is still missing. DSH also removes it fromdsh.profile.bundleswhile leaving it independencies.dsh plugin --profile web add @linxin666/dsh-web-ui-all@0.1.12repairs the profile.Expected behavior
After the package-manager command succeeds, DSH should verify that every declared profile dependency and enabled bundle is actually resolvable.
If validation fails, the command should:
A regression test for a manifest/lockfile/node_modules mismatch would help prevent this from recurring.
Additional note
This appears distinct from discussion #1032, which concerns a missing runtime dependency in a published DSH package. This report concerns profile reconciliation reporting success and mutating the enabled bundle list when the declared dependency is unresolved.
All reactions