Repository navigation
桌面版 0.2.1-rc.2:打包运行(app.asar)启动必失败 desktop welcome: Web authentication failed,解包成目录就正常 #10290
Unanswered
Yuuyuko-uu
asked this question in
Q&A
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.
环境
现象
以打包形式运行(
D:\deepseek\resources\app.asar存在)时,启动必然失败,连续 10 次全部是同一个错误:把同一份
app.asar解包成resources/app目录运行 → 100% 成功,认证返回303再200 OK,主界面正常。也就是说:问题只在
isPackaged = true这条路径上出现。现在我还在用解包目录跑,所以这件事"能绕过去但没修好"。已经排除的可能
asar 文件本身没有损坏
解析它的文件表:18309 个文件、目录结构完整,
dsh/node_modules/@deepseek-ai/dsh-desktop-host/lib/cli.js也在里面。不是"Electron 读不了 asar"
用
ELECTRON_RUN_AS_NODE=1启动 Electron 去读 asar 内部目录,fs.readdirSync正常返回;普通 node 才读不了(ENOENT)——但桌面启动 host 用的正是 Electron 的 node 模式。与第三方插件无关
解包模式下,全部插件(12 个 bundle + 自定义插件)都加载时,启动正常。而且插件报错不会以"认证失败"的形式出现。
「禁用第三方插件」按钮没能真的禁用
这个按钮只把 profile 的
cordis.patch.yml清成了[],但插件实际是挂在
package.json的dsh.profile.bundles里的 —— 那一层没有任何改动,点完之后第三方插件照旧全部加载。(我留有按钮写的空 patch 备份作证。)
缺失的关键信息
crash-*-host.log里只有外层那一句,host 自己输出什么完全看不到。(
DesktopHostProcess里有一个 64KB 的 stderr 环形缓冲,但失败时没有写进 crash log。)建议(按重要性)
现在"认证失败"这一句把四种完全不同的死因(host 起不来 / 端口没开 / 权限 / 内部抛错)压成了同一句话,用户和插件作者都无从下手。
dsh.profile.bundles,否则它不是一个真正的安全模式,无法用来二分定位。isPackaged=true)与解包分支的差异值得查一下:从现象看,外壳在等后端的 ready URL,但打包时没等到可用的那一个。现在的临时解法
把
resources/app.asar改名为.bak,把它的内容解包成resources/app/目录 —— 之后启动、认证、插件全部正常。副作用:
dsh命令行工具仍硬编码app.asar路径,会报MODULE_NOT_FOUND(不影响桌面使用)。English summary: On DSH Desktop 0.2.1-rc.2 (Windows), launching from the packaged
app.asaralways fails atdesktop welcome: Web authentication failed(10/10 attempts), while the same app extracted to a plainresources/appdirectory starts fine (303 → 200). The asar is intact, Electron's node mode can read it, and thefailure is unrelated to third-party plugins. The host child process's stderr is never persisted, so the real cause
cannot be diagnosed. Suggested fixes: persist host stderr into the crash log, and make "disable third-party plugins"
also clear
dsh.profile.bundles.All reactions