Closed dheerajbhaskar closed 7 years ago
The is$$Result
function for me appears on line 200, while the stacktrace says line 348. I'm now wondering if I'm looking at the right package in node_modules (I'm looking at wdio-sync), can there be multiple copies of a package in node_modules, I remember reading somewhere that npm is notorious for having multiple instances of same package, I shall continue searching
Oh!, wdio must be referencing the file under the build directory, the line number matches:
updating the line number 348 to the following seems to work:
return Array.isArray(result) && result.length && result[0] && result[0].ELEMENT !== undefined;
I've not seen any crashes, but that doesn't mean its working, perhaps I need to put in a if block there to console.log whenever result[0] is undefined but result.length is truthy. Seems odd why that would happen, but this is just a temporary fix, I've not dug deeper yet.
I see that this is already fixed. See screenshot:
Is this not in npm yet? Let me check
@dheerajbhaskar no but I can release it
Please do release it, Christian
Already done
Context
I use selenium automation scripts written in webdriverio where it runs a few commands and it stops waiting for all elements (in a CSS selector) to disappear. This used to randomly kill my node process with
UnhandledPromiseRejection
and no stacktrace, I couldn't make headway in fixing this error at all and used to encounter it every few minutes and I used to restart my wdio tests. Now I've gotten the stacktrace, I'm posting it while I myself investigate this further.This code got me the stacktrace
Stactrace