Skip to content

Commit 4b2bd37

Browse files
fix: include sdpi-bridge.js in packaged app via extraResources
The electron-builder 'files' array only packaged dist/, electron/, and package.json. public/bridge/sdpi-bridge.js was never copied into the app bundle. In the packaged app (app.isPackaged === true), main.cjs looks for the bridge at process.resourcesPath/bridge/sdpi-bridge.js. Since the file was absent, net.fetch() returned ERR_FILE_NOT_FOUND, sdpi-bridge.js failed to load, and window.sdpi was undefined in the inspector iframe — causing 'ReferenceError: sdpi is not defined' when clicking Save. Fix: add extraResources entry so electron-builder copies the bridge into resources/bridge/sdpi-bridge.js during packaging.
1 parent a5753c6 commit 4b2bd37

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
"electron/**",
3737
"package.json"
3838
],
39+
"extraResources": [
40+
{
41+
"from": "public/bridge/sdpi-bridge.js",
42+
"to": "bridge/sdpi-bridge.js"
43+
}
44+
],
3945
"linux": {
4046
"target": [
4147
{

0 commit comments

Comments
 (0)