Commit c1aec45
committed
fix(desktop): preload must be CJS when sandbox:true (Electron limitation)
Root cause: 'Renderer is not connected to the main process' was happening
because the preload script never executed. Electron's sandbox mode requires
preload scripts in CommonJS format — ESM (.mjs) preload + sandbox:true is
explicitly unsupported (see https://www.electronjs.org/docs/latest/tutorial/esm).
Fix:
- electron.vite.config: pin preload output to format:'cjs', entryFileNames:'index.js'
- main/index.ts: load 'index.js' (revert the earlier .mjs change)
Verified: window.codesign is now defined, custom base URL field can validate
against proxy endpoints (e.g. https://www.duckcoding.ai).
Signed-off-by: hqhq1025 <1506751656@qq.com>1 parent b41da76 commit c1aec45
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
0 commit comments