Repository navigation
fix(windows): 取 AO 内部模块统一转 file:// URL(Windows 上八处静默失效) - #14
Merged
Merged
Conversation
Windows 上 import('D:\…') 抛 ERR_UNSUPPORTED_ESM_URL_SCHEME,外面的 catch 又把它吞了:
界面存的 key 重启也不生效、设置面板列不出供应商、代理装不上、配音回落/本机出图取不到模块。
#12 的端点测试在 Windows CI 上红了,上一笔加的那行日志直接点出了原因。
- 新增 src/core/ao-module.mjs(importAo),替换全部八处
- 测试:必须是 file:// URL / 四个 AO 模块都取得到 / 仓库里不许再有裸路径 import;两个变异都会红
- 本机真服务复跑 #12 复现脚本、带代理跑 doctor,行为不变;全量 275 测试 0 失败
This was referenced Sep 21, 2026
jnMetaCode
added a commit
that referenced
this pull request
Sep 23, 2026
白屏闸只证明 dist/index.html 在包里,不证明它能跑。#14 证明这不够:Windows 上八处取引擎模块的 调用一直静默失败,三平台 CI 全绿。新增 desktop/scripts/smoke-packaged.sh,用包自带的 Electron 当 Node 起包内 server,打五条页面一打开就会请求的路由(含两条要取引擎内部模块的)。 本机 mac-arm64 真跑 1.2 秒通过;两个变异(打断引擎模块路径 / 后端启动即崩)都会红。 desktop-v0.1.1 打在 alpha.25 上,桌面用户至今拿不到 MCP / 本机 Ollama / 本机看图,故版号提到 0.1.2。
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.
#13 合入后 main 的 Windows 测试是红的——不是 #13 引入的问题,而是它的新测试第一次照到了一个一直存在的 Windows bug。
根因
八处把拼出来的绝对路径直接交给
import()。Windows 上盘符路径被当成d:协议,抛ERR_UNSUPPORTED_ESM_URL_SCHEME,外面多半还包着 catch:/providers/text500,列不出供应商macOS / Linux 上裸路径恰好能用,开发机上永远撞不到。
改动
src/core/ao-module.mjs:importAo(...segments),先pathToFileURL再 import;替换全部八处tests/ao-module.test.mjs:必须是 file:// URL;四个 AO 模块都取得到;仓库里不许再有裸路径 import(两个变异检查都会红)验证