electron-builder: Electron-build has error in building with "Cannot read property 'channel' of null"
I am using Electron builder to build Electron app for Mac. I have built for Window and Linux successfully, but when I tried in building for Mac, I have the following error.
Can not Cleanup: TypeError: Cannot read property 'channel' of null
Electron version 23.1.1 Electron builder version 23.6.0
How to fix this error?
This is my builder config.
{
"appId": "com.test.testApp",
"directories": {
"output": "dist"
},
"files": ["build/**/*", "node_modules/**/*", "public/**/*", "electron.js"],
"publish": {
"provider": "github"
},
"win": {
"target": "portable"
},
"dmg": {
"title": "${productName} ${version}"
},
"linux": {
"target": ["AppImage", "deb"]
}
}
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 20 (4 by maintainers)
Have you tried resolving this message first?
Looking at the codebase, it’s unable to resolve your
publishconfig. Since it’s github-dependent, I’d recommend fixing the warning first and report backSo the problem happens in my end because I have a
GITHUB_TOKENenvironment variable in my terminal, and somehow the electron-builder or electron-publisher package assumes that, if I have that, then I want to publish, but rest of publish params are not given so here the inconsistency, some bad check in the library internals and booom.“Issue closed because it has been stalled for 5 days with no activity”? Wow 😀
I’m also experimenting same issue consistently. By looking at the code is clear that something is calling
computeChannelNames()inapp-builder-lib/src/publish/updateInfoBuilder.tsby passingnullinpublishConfigfunction argument:So that line throws because it’s trying to read
null.channel. Interesting thing is that TypeScript doesn’t complain in my app.Tried to run the project locally with
open ./dist/mac-arm64/dropbox.app --args --remote-debugging-port=8080 --inspect-brkand I’m seeing this in the logsI can’t seem to access the remote debugging port, I have
⚠ Remote browser is newer than client browser.in my Inspect and I’m not sure how to resolve that as I’m on latest Chrome AFAICT. About Chrome shows up-to-date110.0.5481.177 (Official Build) (arm64)https://github.com/akachi1409/dropbox-app Invited you.
Can you just leave
publishempty instead of explicitly null? That seems like it’d be the same purpose, but null isn’t working obv.