For those using electron by itself with a package.json file. make sure to include the path to the png with the "icon" key.
example:
{
"name": "app",
"version": "1.0.0",
"description": "generic description",
"main": "main.js",
"type": "module",
"icon": "./path/to/icon.png",
}