I have built the electron app and now want to use Tray feature as mentioned here
i am giving icon path which is located in the build folder at the base location as shown below
tray = new Tray(`file://${__dirname}/build/icon.ico`);
But this is throwing the following error
I want to know how to use the icon as its not mentioned in the documentation.
this worked for me .Although the size of the icon has to be small to be shown
const { Tray, nativeImage } = require('electron');
const iconPath = path.join(__dirname, 'build/icon-st.png');
mainWindow.tray = new Tray(nativeImage.createFromPath(iconPath));