-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Uncaught Exception: TypeError: Error processing argument at index 0, conversion failure from file:///root/doc_electron/chef.ico #9795
Comments
You need to use a file path to specify the icon, not a URL. |
@enlight using a file path does not make it work either |
Can you update the snippet you posted to show how you've specified the file path? |
Woo hoo, my turn to close this 😆
|
In case someone ends up here without finding a solution that works, here are the steps I'd recommend:
// If not already imported
// const path = require('path');
const iconPath = path.join(__dirname, 'tray-icon.png');
const trayIcon = nativeImage.createFromPath(iconPath);
const tray = new Tray(trayIcon);
let trayIcon = nativeImage.createFromPath(iconPath);
trayIcon = trayIcon.resize({ width: 16, height: 16 }); |
This also helps resolve issues like electron/electron#9795 during packaging.
Electron Version: 1.7.2
Operating System: Linux 4.4.0-kali1-amd64 #1 SMP Debian 4.4.6-1kali1 (2016-03-18)
Am currently following the electron documentation, but the Tray api is not working, it spits out this error
Uncaught Exception:
TypeError: Error processing argument at index 0, conversion failure from file:///root/doc_electron/chef.ico
at App.app.on (/root/doc_electron/tray.js:6:10)
at emitTwo (events.js:111:20)
at App.emit (events.js:194:7)
This is the code
The text was updated successfully, but these errors were encountered: