electron icon indicating copy to clipboard operation
electron copied to clipboard

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

Open meghajayakumar opened this issue 3 years ago • 2 comments

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):

  • OS: Windows
  • Version : 10

meghajayakumar avatar Jul 22 '22 13:07 meghajayakumar

'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

JuliusSkrisa avatar Aug 22 '22 13:08 JuliusSkrisa

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

kimindu avatar Jul 27 '23 03:07 kimindu