Issues setting SystemTray image



I have been setting up an application and when i run the app for testing i get an error on the conversion of the ico file.

I have tried downloading the ico and i get the same issue. below is the code i have for setting up the system tray. I have even tried setting this using a png file and get the same results. If im using a debugger like VScode i get the error when i first click run and if i hit rerun i can run the application which really bugs me and i cant figure out why.

systemtray = new Tray("./images/Toolkit.ico");

if someone has any insight that would help alot. I have the app about done but with this error i cant package it and hand it out.


Try this instead:

const path = require('path')
systemtray = new Tray(path.join(__dirname, "images", "Toolkit.ico"))


Thank you for your replay, I tried that and received the same error.


So your played some more with your idea and for some reason in the Tray method it has an issue but having the code dump to a variable and then pass the variable with the full path corrected the issues. Thank you for your help.