Skip to content
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

Error during update download #55

Closed
ilgrandeanonimo opened this issue Oct 19, 2021 · 12 comments
Closed

Error during update download #55

ilgrandeanonimo opened this issue Oct 19, 2021 · 12 comments

Comments

@ilgrandeanonimo
Copy link

Found version 2.0.0 (url: myapp-2.0.0-arm64-mac.zip, myapp-2.0.0-arm64.dmg)
(node:8559) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'enabled' of undefined
at /Users/gattino09/Dev/NodeJS/Electron/myapp/dist/mac-arm64/myapp.app/Contents/Resources/app.asar/main.js:130:23
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use myapp --trace-warnings ... to show where the warning was created)
(node:8559) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8559) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@iffy
Copy link
Owner

iffy commented Oct 19, 2021

Can you show me what's on line 130 of your main.js file?

@ilgrandeanonimo
Copy link
Author

  updater.enabled = true

@ilgrandeanonimo
Copy link
Author

the complete function:
!! the title, the message and the buttons are in Italian.

autoUpdater.on('update-available', () => {
dialog.showMessageBox({
type: 'info',
title: 'Aggiornamento Disponibile',
message: 'è disponibile un aggiornamento installarlo?',
buttons: ['Si', 'No']
}).then((buttonIndex) => {
if (buttonIndex === 0) {
autoUpdater.downloadUpdate()
}
else {
updater.enabled = true
updater = null
}
})
})

@iffy
Copy link
Owner

iffy commented Oct 19, 2021

@yap241986 I don't know what updater is in your code. It's not part of this example application though.

@ilgrandeanonimo
Copy link
Author

if I sent to you all my code you can try to fix that problem?
(if you see grammatical error the reason is that I'm Italian)

@iffy
Copy link
Owner

iffy commented Oct 19, 2021

@yap241986 That's not really the purpose of this repo. I suggest you start from this template and slowly add your own parts one at a time. Or work in reverse. Remove lines of your code until you don't get an error any more.

@iffy
Copy link
Owner

iffy commented Oct 19, 2021

For instance, if you remove updater.enabled = true I think you wouldn't get an error anymore.

@ilgrandeanonimo
Copy link
Author

thank you I only remove the custom messages.

@ilgrandeanonimo
Copy link
Author

how can I set a custom html progress bar for update progress/download?

@iffy
Copy link
Owner

iffy commented Oct 20, 2021

@yap241986 Take a look at the download-progress event: https://www.electron.build/auto-update#event-download-progress

@ilgrandeanonimo
Copy link
Author

<title>Update Downloading...</title> Update In Download...
<script> const { autoUpdater, MacUpdater, DOWNLOAD_PROGRESS } = require('electron-updater') alert(DOWNLOAD_PROGRESS) document.getElementById("percentual.dl"). <---- what's the code that I put here? </script>

@iffy
Copy link
Owner

iffy commented Oct 21, 2021

@yap241986 I don't know. There are many ways you could do it. Here's what I found searching "electron-updater progress bar": https://stackoverflow.com/a/54533407/1379037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants