Repository navigation
fix(electron): resolve main output root from inside Rollup chunks - #1307
Merged
vastsa merged 2 commits intoOct 2, 2026
Merged
Conversation
Rollup emits Main as out/main/index.js plus shared chunks under out/main/chunks/. getModuleDirectory returned the chunk directory, so renderer/preload/plugin-host paths resolved one level too deep and the window loaded a missing index.html (black screen).
vastsa
requested changes
Oct 2, 2026
vastsa
left a comment
Owner
There was a problem hiding this comment.
当前不建议合入。这个改动修复了可见的启动黑屏路径,但 PR 只改了 module-path.ts,没有提交能在旧实现上失败的回归测试,也没有按仓库要求更新对应的 E2E 启动场景文档。PR 描述中的临时 node 直验不能在后续改动时自动防止回归。
请补一个针对 getModuleDirectory() 的自动化回归用例,覆盖入口模块与 out/main/chunks/*.js 都解析到 out/main,并更新 docs/spec/06-delivery/04-e2e-test-plan.md 中的启动场景,明确覆盖 Main 共享 chunk 下的 renderer/preload 路径。然后在包含最新 origin/main 的候选上运行相关测试和 Electron 启动 E2E。
我确认 PR head 包含当前 origin/main,GitHub CI、PR base 检查均通过。此处隔离 worktree 的本地 typecheck 与 E2E 未能有效运行:pnpm 拒绝共享的 node_modules 根符号链接;直接 typecheck 使用了不完整/陈旧的 workspace dist,启动 E2E 也因 Desktop 未构建而退出。这些本地限制不影响 CI 结果,但当前也没有上述回归覆盖,因此先 request changes,不合入。
Add a regression test proving getModuleDirectory() resolves to out/main from both the entry bundle and out/main/chunks/*.js, so renderer/preload/plugin-host paths cannot drift one level deep again. Document the shared-chunk layout in E2E-001.
Contributor
Author
|
已按反馈补充(b043189e0):
|
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.
紧急修复:打开黑屏。
原因: Rollup 把 Main 拆成 out/main/index.js + out/main/chunks/,getModuleDirectory 返回 chunk 目录,导致 renderer/preload/plugin-host 路径深了一层,窗口加载到不存在的 index.html。
改动(最小,1 文件):
验证: