Skip to content

Commit 7a7dbaf

Browse files
authored
fix: SEA_MAIN only supports CommonJS (#64)
``` PS C:\Users\circleci\project> .\node_modules\electron-winstaller\vendor\signtool.exe --version (node:4288) Warning: Failed to load the ES module: sea.js. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension. (Use `signtool --trace-warnings ...` to show where the warning was created) sea.js:2 import { spawnSync } from 'node:child_process'; ^^^^^^ SyntaxError: Cannot use import statement outside a module at embedderRunCjs (node:internal/main/embedding:60:7) Node.js v22.17.1 ``` > The single executable application feature currently only supports running a single embedded script using the [CommonJS](https://github.com/nodejs/node/blob/main/doc/api/modules.md#modules-commonjs-modules) module system.
1 parent 34298ad commit 7a7dbaf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sea.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ const FILENAMES = {
5656
};
5757

5858
const SEA_MAIN_SCRIPT = `
59-
import { spawnSync } from 'node:child_process';
6059
6160
const bin = "%PATH_TO_BIN%";
6261
const script = "%PATH_TO_SCRIPT%";
6362
const options = %WINDOWS_SIGN_OPTIONS%
6463
64+
const { spawnSync } = require('node:child_process');
65+
6566
function main() {
6667
console.log("@electron/windows-sign sea");
6768
console.log({ bin, script });

0 commit comments

Comments
 (0)