I have never touched electron until last night, making a menubar only app, followed the docs etc. and I just cant get it to show any icon in my menubar, the app does launch and I can click it to see my menu, it just doesnt have an icon
import { app, Menu, Tray, nativeImage } from 'electron';
import { platform } from 'node:process';
import path from 'path';
let tray: Tray;
app.whenReady().then(() => {
const iconPath = path.resolve(__dirname, 'Icon.png');
console.log(iconPath) // correct path
const icon = nativeImage.createFromPath(iconPath);
tray = new Tray(icon);
const contextMenu = Menu.buildFromTemplate([
{ label: 'hi', type: 'normal', click: () => console.log('hi clicked') },
{ type: 'separator' },
{ label: 'Quit', role: 'quit' },
]);
tray.setContextMenu(contextMenu);
if (platform === 'darwin') {
app.dock.hide();
}
});