-
Notifications
You must be signed in to change notification settings - Fork 176
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 #1063
Comments
It looks like you're using syntax that isn't supported by your Node.js version. Node 14 is end-of-life. You're either going to need to update Node to a newer version, or use an older version of lab. |
@cjihrig - But older versions like 24.0.0 is throwing errors in windows like the following. What should i do now? Kindly advise
|
Oh, you reported two bugs in the same issue 😅. Sorry about that. Reopening. Do you have something that reproduces the issue that you can share with us? |
@cjihrig Thanks for re-opening :). Sure, let me explain clearly. My team is working in windows OS having node version v14.5.0 and npm version 6.14.5. We are using "@hapi/lab": "24.0.0" and when we are trying to generate unit test coverage report, we are receiving following errors and report is not generated at all(HTML report where we see coverage file i mean).
When we investigated further and we noticed while debugging in node_modules that cov.files as null with the following error
This issue is only reproducible in Windows OS alone but in Mac OS it works fine and coverage report generates for the same version 24.0.0. My team is blocked at the moment on this and any help would be really appreciated. Thanks |
Your versions of both Lab and Node are not only old, but also not even updated to the latest release of the line (v24.7.1 for Lab, and v14.21.3 for node). We don't have the bandwidth to support such old releases, so please try to update to the never versions and verify that it is still an issue. I expect that you will find that it solves it. |
Hi @kanongil for some other reasons we are holding the older versions, but anyways i will try like you suggested by updating both lab and node versions. Will keep you posted here. Thank you so much for your time. |
Hi @kanongil We tried with v24.7.1 for Lab, and v14.21.3 for node. But we encounter the following error in windows OS(Windows 10 Enterprise). Any suggestions?
|
Hi @sathyalog! I just encountered the same issue. The problem is that Lab depends on A quick way to work around that would be to install your own version of bossy locally which would override the one used by Lab. Just install the @kanongil I think it's just a matter of fixing the correct dependency here. |
Ok, I just realized (actually @Nargonath) that it was a problem with my old So just remove your |
@roux1max Thanks for reporting. From your initial description, cached dependencies seemed a likely culprit. |
Support plan
Context
How can we help?
we are using hapi/lab version 24.0.0 and when we are trying to run the unit test coverage in windows laptop it was throwing following error and not generating html to see the coverage report. hence we updated version to 25.0.1 which worked fine in windows and mac, we were able to see the coverage reports html file. But it started failing in azure pipelines like shown in below snippet. Hence we are blocked and unable to progress on unit test cases. Any help would be highly appreciated.
Windows error:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of null at C:\project\node_modules@hapi\lab\lib\reporters\html.js:143:76 at Array.map () at module.exports.internals.Reporter.internals.Reporter.end (C:\project\node_modules@hapi\lab\lib\reporters\html.js:132:61) at module.exports.internals.Reporter.reporter.finalize (C:\project\node_modules@hapi\lab\lib\reporters\index.js:93:28) at module.exports.internals.Reporter.internals.Reporter.finalize (C:\project\node_modules@hapi\lab\lib\reporters\multiple.js:78:65) at processTicksAndRejections (internal/process/task_queues.js:93:5) at main (C:\project\node_modules@hapi\lab\bin\lab:56:20) (node:5732) 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: 95)We also added "@hapi/eslint-plugin" as well.
Kindly please let me know if is there any resolution for this? thanks
The text was updated successfully, but these errors were encountered: