-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
UnhandledPromiseRejectionWarning #57
Comments
I've had this error for a while and just now looked into it. Seems a breaking bug was introduced by a node dependency and no fix has been released yet. You can follow the progress here Alternatively, I've lowered my node version to v18, which uses a version of the dependency before the bug was introduced. This has fixed the issue for me so you can do that in the meantime. If you don't have it, I recommend installing nvm to make switching node versions easy |
@NashJames hi. Which exact version of node works? I tried with v18.20.3 and no good. I get the same problem as mentioned in the above post. I also tried v18.0.0 and it doesn't help. |
@uros76 After trying again myself, it seems that this fixed some of my instances of the mirror and not others (they have differing project and module versions). It's possible I've missed something in the nodejs codebase. According to this comment, they should release a proper fix with node |
Did anyone got it working? I am on node v22.13.0 and get the same error. |
I gave up on this module and feed the AQI data from my smart home HomeAssistant. |
You won't be able to get this module working unless you downgrade magicmirror to v2.26.0; which would then require you to downgrade a number of other modules. It will work in headless mode ( For anyone curious, NodeJS released a bug for the fetch API which they promptly resolved. Unfortunately, electron bundled this broken version of NodeJS into their releases which MagicMirror began using in the release following the one listed above. I wouldn't expect an update from Electron or MagicMirror with a fix soon. To be clear it's not the maintainers fault; though a comment in the README summarising this would be useful for anyone considering using the module. |
Just updated MM to version 2.27.0, and discovered MMM-AirQuality no longer loads (data is stuck on Loading.....)
Running PM2 Log gives the below error trace
0|mm | [2024-04-19 12:28:11.472] [ERROR] (node:1100) UnhandledPromiseRejectionWarning: TypeError: fetch failed
0|mm | at Object.fetch (node:internal/deps/undici/undici:12293:11)
0|mm | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|mm | at async Class.loadData (/home/mirror/MagicMirror/modules/MMM-AirQuality/helper.js:21:20)
0|mm | (Use
electron --trace-warnings ...
to show where the warning was created)0|mm | [2024-04-19 12:28:11.477] [ERROR] (node:1100) 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)The text was updated successfully, but these errors were encountered: