capacitor-community / capacitor-community/electron
Unable to load preload script \@capacitor\electron\dist\electron-bridge.js
- Dominant language
- TypeScript
- Stars
- 398
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Just migrated from electron 8.5.5 to 19.0.9 for an electron ionic desktop application project. When trying to open electron window with the command 'npx cap open electron', it throws an error: Unable to load preload script: ..electron\node_modules\@capacitor\electron\dist\electron-bridge.js
**Implementation**
```
mainWindow = new BrowserWindow({
width: 400,
height: 700,
resizable: false,
title: "Desktopia",
show: false,
icon: path.join(__dirname, 'favicon.ico'),
webPreferences: {
backgroundThrottling: false,
nodeIntegration: true,
preload: path.join(__dirname, 'node_modules', '@capacitor', 'electron', 'dist', 'electron-bridge.js')
}
});
```
**Expected behavior**
Electron window should open with the command 'npx cap open electron'
**Screenshots**


**Desktop (please complete the following information):**
- OS: Windows
- Version : 10
Contributor guide
Assessment
This issue has not been assessed yet.