Electron Builder: Not allowed to load local resource: app.asar/build/index.html
I think your index.html file is not present in your given location. __dirname, '/build/index.html'
I missed this silly point and wasted a lot of time. Angular-cli creates default location for index.html inside a folder in dist.
dist/project-name/index.html
Solved by adding "files" in package.json
"files": [
"*.js",
"build",
"node_modules"
],
I got a similar problem and was missing the path.join
:
Bad Code:
win.loadFile('index.html')
Fixed Code:
win.loadFile(path.join(__dirname, 'index.html'))