-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
Multiple (node:17870) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
#3828
Comments
Thanks for reporting this @eXhumer! Looks like this is longstanding behaviour in Packager (the Going to move this issue over to the Packager repo (thanks for isolating the root cause) as well. |
👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
I get the same problem, Any one Can fix it? But, it seem no effect to main process. |
@LY1806620741 I don't think this has an impact on Packager's runtime. If you're running Node.js v21 or higher, they just added a new flag to silence specific warnings. https://nodejs.org/en/blog/release/v21.3.0#new---disable-warning-flag |
👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
Sorry for waffling about by transferring this issue across repos over and over again. I took a closer look at what needs to be done to fix this (because Node 22 LTS crept up on me and this is happening everywhere). At a base level, we technically accept async/Promise-based functions in the Packager code already. However, this causes problems with DEP0174 because we blindly apply We're at a point in time where people probably want to write async code via Promises, so there isn't really a point in keeping callback compatibility for the future. Since we're preparing a new major version of Forge as part of our initiative to move ecosystem packages to Node 22, this is probably the best approach for the long term:
In the short-term, I'm not sure if the effort is worth it to refactor a bunch of our code to use antiquated callback-based asynchronous control flow, so this issue might live here until the next major release. |
Pre-flight checklist
Electron Forge version
7.4.0
Electron version
v30.0.1
Operating system
macOS 14.4.1 (darwin/arm64)
Last known working Electron Forge version
No response
Expected behavior
No deprecation warning when running
package
ormake
scripts.Actual behavior
Multiple
(node:17870) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake.
warnings in console.For macOS universal builds, I have to use a
packageAfterExtract
hook to delete a file in macOS application package. For macOS/Windows builds, I am also having to run apostPackage
hook modify the package slightly to add a file and for code signing / notarization. With or without these hooks added, I keep getting those warnings multiple times while runningpackage
ormake
scripts, even on a cleannpm create electron-app
output. I addedNODE_OPTIONS=--trace-deprecation
to get more information regarding this and all of it seems to be caused bypromisifyHooks
.Console output with warnings
Steps to reproduce
Additional information
I am using the following forge configuration currently when I get these deprecation warnings.
https://github.com/eXhumer/eXViewer/blob/6cb73d39972add0aff25580b3abf307f3f757979/forge.config.ts
The text was updated successfully, but these errors were encountered: