Skip to content

Commit 3b9b93a

Browse files
committed
fix(desktop): preload must be .cjs, not .js (apps/desktop has type:module)
Previous fix wrote CJS code but kept .js extension. Because apps/desktop/package.json has "type":"module", Node treated the .js preload as ESM and refused to load it — silently — so window.codesign never got exposed and every IPC call failed with 'Renderer not connected'. Use .cjs extension so Node honors the format regardless of package type. Signed-off-by: hqhq1025 <1506751656@qq.com>
1 parent c1aec45 commit 3b9b93a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/desktop/electron.vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default defineConfig({
1717
outDir: 'out/preload',
1818
rollupOptions: {
1919
input: { index: resolve(__dirname, 'src/preload/index.ts') },
20-
output: { format: 'cjs', entryFileNames: 'index.js' },
20+
output: { format: 'cjs', entryFileNames: 'index.cjs' },
2121
},
2222
},
2323
},

0 commit comments

Comments
 (0)