Electron Builder: Not allowed to load local resource: app.asar/build/index.html

Emre Tekince picture Emre Tekince · Jul 10, 2017 · Viewed 15.9k times · Source

I have an issue when using electron builder I got blank page and error in console:

Not allowed to load local resource: file:///C:/Users/emretekince/Desktop/DCSLogBook/client/dist/win-unpacked/resources/app.asar/build/index.html

main.js

const startUrl = process.env.ELECTRON_START_URL || url.format({
        pathname: path.join(__dirname, '/build/index.html'),
        protocol: 'file:',
        slashes: true
    });
mainWindow.loadURL(startUrl);

Answer

Emre Tekince picture Emre Tekince · Jul 11, 2017

Solved by adding "files" in package.json

"files": [
  "*.js",
  "build",
  "node_modules"
],