0

The app works fine when I run it via $npm start. After I have built the app using electron-packager the javascript within the built app can't find assets in the images directory.

Example: I define the app icon in my main.js var mb = menubar({width: 370, height: 210, preloadWindow:true, icon: 'img/icon/icon.png'}); It gives the error Uncaught Error: ENOENT: no such file or directory, open 'img/icon/icon.png'.

If I load the image in the HTML it works fine.

Andy
  • 127
  • 3
  • 9

1 Answers1

1

Relative paths cease to work after packaging for distribution, you'll have to create your paths using __dirname.

Jens Habegger
  • 5,266
  • 41
  • 57