New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'port' of null at getServerUrl -- any way to fix without updating electron app? #6177
Comments
Just spitballing here — since it sounds like you're able to set the feed URL of the native Electron auto-updater from the front-end, you could potentially inject an update script that points to a URL to download a specific JSON payload supported by Squirrel that specifies a patched release. This would only work for Mac, not sure how to do the same on Windows. One note: you would need to specify the autoUpdater.setFeedURL({
url: 'https://example.com/emergency-patch.json',
serverType: 'json',
})
autoUpdater.checkForUpdates() Honestly, I'm not even really sure if that would work. It would depend on your app's security model, I'd assume. But it might be worth exploring since you mentioned it. |
Interesting -- i'll definitely try it out! Luckily our app is only available for MacOS right now. I was thinking something along those lines, but I didn't know the format accepted by Squirrel, so thanks for pointing me to those docs :) |
Thanks for jumping in here @ezekg, really appreciate it!
Coincidentally, this @nikcheerla, please let us know if you're able to make progress with that route. Regarding one of your other questions, I've never seen an issue like this occur before. It's also rare that dev work is done in electron-updater though, most of the time it's in the app builder flow. |
Yup, I'm able to release frontend updates separately from electron shell updates! |
@ezekg the setFeedURL approach works! There are some small caveats (for example, we can never know when the update actually finished downloading in Squirrel, which is a little annoying), but in general running that with a JSON server I created, waiting 30 seconds, then calling quitAndInstall() seems to reliably update. Thanks for the suggestion! @mmaietta I want to update to the latest version of electron-updater still so I can get in the M1 updating fix, but I want to make sure it actually works this time :) How will I know when 4.4.6 is stable? |
I'm not familiar with any standardized process (for electron-builder or any package really), I figured 'next' versions are only marked 'latest' after being deployed in the wild for a month or so. Being open source with active community contributions (💪🏻), I can't guarantee release regression suites on par with public companies. That being said, I do believe 4.5.0 to be quite stable, especially with the fix you are needing for Mac. I'm actually working on adding more electron-updater integration tests as one of my next tasks, found that there's a few blind spots that have been there for a long time. |
22.11.4
v16.6.1
13.1.6
current
4.4.5
Mac (intel and M1)
So I mentioned this in #6170 but I'm having a major issue with electron-updater just completely failing to download an update because of the 'Cannot read property port of null' issue. Unfortunately, we shipped the latest version production app to our users with this update code, so we can't deploy an update to fix the update issue! Our users are effectively stranded on the last version of the electron app we released.
I still don't completely understand the bug, does this mean that all updates everywhere in electron-updater are broken? Is there some type of release server that would still work?
We have access to remote.autoUpdater from the frontend, so we can e.g set the feed URL or something for autoUpdater, not sure if that will help though.
Any ideas for how we can possibly fix electron auto updating without having to do an update electron side? Has anyone dealt with an issue like this before with electron-updater? I just donated, this is super important to us to fix soon and would love any help any of you could provide.
The text was updated successfully, but these errors were encountered: