The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

16639 (3) [Avatar] Offline
#1
Hi,

After packaging the lorikeet application for OS X with the command "npm run pack", when I double-click the Application the index.html file doesn't seem to load. The window content is white.

If I use the Terminal to launch the Application, everything is working fine.

$ ./dist/osx/lorikeet.app/Contents/MacOS/lorikeet

Thanks in advance for any help.

Martin
16639 (3) [Avatar] Offline
#2
Hi,

I found a workaround.

When launching by double-click, process.cwd() doesn't return the good path, using app.getAppPath() instead is working fine.

Line 15 in main.js
mainWindow.loadURL('file://' + app.getAppPath() + '/index.html');
//mainWindow.loadUrl('file://' + process.cwd() + '/index.html');


Martin
paulbjensen (39) [Avatar] Offline
#3
Hi,

Thanks for your suggestion, I will incorporate it into that chapter.

Regards,

Paul Jensen
paulbjensen (39) [Avatar] Offline
#4
You're welcome, thanks for suggesting that fix, I think I also had to use it for getting electron and cucumber to play ball in the testing chapter.