angular-electron icon indicating copy to clipboard operation
angular-electron copied to clipboard

Unable to load index.html when packed in to asar file

Open woodman231 opened this issue 8 years ago • 3 comments

Hey Maxime, gret repo. I have really enjoyed using it. I have been coding an app based on it for a couple of months now and I am having some problems compling / using it on other computers beside my own. My Project works just fine on my computer but then on other computers I am getting "not allowed to load resource "file://localclonedpath/dist/index.html".

When looking at the dist folder sure enough "index.html" is missing. When logging __dirname on this computer that won't compile correctly it says: "/localclonedpath/node_modules/electron/dist/resources/electron.asar/renderer", When logging __dirname on the computer that does work properly it shows "/localclonedpath/dist" and that file "index.html" is in there after running the npm start. So why do you think the results of npm start are different on the different computers?

A couple of version stuff that i can think to provide: Working Computer: Windows 10 git version 2.10.2.windows.1 npm 3.10.8 node 6.9.1 process.versions.electron 1.7.8 process.versions.chrome 58.0.3029.110

Computer that isn't working: Ubuntu Desktop 18.04 LTS git version 2.17.1 npm 3.5.2 node v8.10.0 process.versions.electron 1.7.8 process.versions.chrome 58.0.3029.110

I also did this on a Windows server 2016 and I am getting the same problem where it doesn't have the renderer information directly in the dist folder. So I am just confused and not sure what to do with the fact that this works on my computer but after I clone it and run npm install, then npm run. It doesn't seem to work.

woodman231 avatar Jun 19 '18 01:06 woodman231

Same problem here...

image

With npm run electron:local everything runs good

with npm run electron:windows, the problem arised.

sanchezpablo avatar Jul 09 '18 22:07 sanchezpablo

@Robbyn666 This approach saved my day. Thank you!

stugreen13 avatar Sep 12 '18 19:09 stugreen13

@stuartbgreen what approach are you referring here?

zirhoo avatar Mar 13 '24 18:03 zirhoo