capacitor-community / electron

Deploy your Capacitor apps to Linux, Mac, and Windows desktops, with the Electron platform! 🖥️
https://capacitor-community.github.io/electron/
MIT License
318 stars 58 forks source link

Unable to load preload script \@capacitor\electron\dist\electron-bridge.js #202

Open meghajayakumar opened 1 year ago

meghajayakumar commented 1 year ago

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 image image

Desktop (please complete the following information):

JuliusSkrisa commented 1 year ago

'npx cap open electron' is referencing discontinued electron platform, and not the capacitor-community platform where you are writing this issue. If you want to use this capacitor-community platform read the docu

kimindu commented 11 months ago

npx cap copy @capacitor-community/electron is same error....