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

[BUG] Does not handle undefined return value from signal-exit's onExit() function #84

Open
kayahr opened this issue Oct 2, 2021 · 1 comment
Labels
Bug thing that needs fixing

Comments

@kayahr
Copy link

kayahr commented Oct 2, 2021

According to the documentation of signal-exit the onExit function always returns a function. But according to the actual source code this is not true. The function can return undefined in specific circumstances (I encounter this within Electron) and write-file-atomic fails when trying to call this undefined function.

I guess the function call should be wrapped with a null check.

@darcyclarke darcyclarke added the Bug thing that needs fixing label Jul 28, 2022
@rleikis
Copy link

rleikis commented Sep 18, 2024

Just ran into this last night as our team was trying to ship a beta release. It is a Electron app using the electron-settings package. Local dev and electron-builder output worked. This error didn't appear to occur in our app until built via a Github workflow.

I haven't figured out why this issue occurs nor do I have time to find out. My only option is to tear it out and use something else.

[2024-09-17 09:50:03.532] [error] Error occurred in handler for 'load-stations-file': TypeError: onExit is not a function
at writeFileAsync (C:\Users\user\AppData\Local\Programs\app-name\resources\app.asar\node_modules\write-file-atomic\index.js:82:31)
at writeFile (C:\Users\user\AppData\Local\Programs\app-name\resources\app.asar\node_modules\write-file-atomic\index.js:164:19)
at C:\Users\user\AppData\Local\Programs\app-name\resources\app.asar\node_modules\electron-settings\dist\settings.js:265:49
at new Promise ()
at C:\Users\user\AppData\Local\Programs\app-name\resources\app.asar\node_modules\electron-settings\dist\settings.js:263:16
at async LoadStations (C:\Users\user\AppData\Local\Programs\app-name\resources\app.asar\out\main\index.js:1499:7)
at async WebContents. (node:electron/js2c/browser_init:2:77963)

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

No branches or pull requests

3 participants