Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
Electron: electron-builder unable to load preload script

I have an issue with Electron unable to load BrowserWindow preload script. With the next error line:

Unable to load preload script: C:\Users\user\AppData\Local\Programs\myApp\resources\app.asar\electron\preload.js

Here are the versions I use: "electron": "^11.0.1", "electron-builder": "^22.3.6". Also here is the script I launch the new window:

const win = new BrowserWindow({
  width: 1400,
  height: 900,
  frame: false,
  title: title.name,
  webPreferences: {
    frame: false,
    webviewTag: true,
    nodeIntegration: true,
    enableRemoteModule: true,
    nodeIntegrationInWorker: true,
    preload: path.join(`${__dirname}/electron`, 'preload.js'),
  },
});

The weird part about this is that I have another Electron app with an older Electron version and I have no issues whatsoever, versions: "electron": "^8.2.3" & "electron-builder": "^22.5.1".

const win = new BrowserWindow({
  width: 1400,
  height: 900,
  frame: false,
  title: title.name,
  webPreferences: {
    preload: path.join(`${__dirname}/electron`, 'preload.js'),
    nodeIntegration: true,
    nodeIntegrationInWorker: true,
    webviewTag: true,
  },
}); 

The only differences I have is nodeIntegrationInWorker and enableRemoteModule. Are any of these properties not allowed to work together? Or is this the Electron version deprecating some of them? How can I fix the error

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda