xolvio / chimp

Tooling that helps you do quality, faster.
MIT License
798 stars 139 forks source link

Unhandled error from cucumber #441

Closed bsommardahl closed 8 years ago

bsommardahl commented 8 years ago

When I run my specs and there is any unexpected error (element not found, tabid doesn't exist, etc), I get an unfriendly error from the depths of cucumber:

[chimp] Detected an unhandledRejection:
[chimp][hooks] TypeError: Cannot read property 'getFileName' of undefined
    at isFrameInCucumber 

It doesn't matter what kind of error is happening to cause it, the reported error is always the same.

Used version
[chimp] Detected an unhandledRejection:
[chimp][hooks] TypeError: Cannot read property 'getFileName' of undefined
    at isFrameInCucumber (/usr/local/lib/node_modules/chimp/node_modules/cucumber/lib/cucumber/runtime/stack_trace_filter.js:9:23)
    at Array.<anonymous> (/usr/local/lib/node_modules/chimp/node_modules/cucumber/lib/cucumber/runtime/stack_trace_filter.js:15:9)
    at TraceModifier._modify (/usr/local/lib/node_modules/chimp/node_modules/stack-chain/stack-chain.js:44:32)
    at Function.prepareStackTrace (/usr/local/lib/node_modules/chimp/node_modules/stack-chain/stack-chain.js:119:25)
    at trackRejection (/usr/local/lib/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/node_modules/q/q.js:1066:32)
    at reject (/usr/local/lib/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/node_modules/q/q.js:1131:5)
    at deferred.reject (/usr/local/lib/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/node_modules/q/q.js:633:16)
    at run (/usr/local/lib/node_modules/chimp/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:87:22)
    at /usr/local/lib/node_modules/chimp/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:100:28
    at flush (/usr/local/lib/node_modules/chimp/node_modules/babel-runtime/node_modules/core-js/library/modules/_microtask.js:18:9)
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)

Join our Slack xolv.io/community #chimp channel, where you can find help and help others.

samhatoum commented 8 years ago

Try updating Node to 6.x

alanning commented 8 years ago

For reference, looks like there is an open issue on the cucumber repo too: https://github.com/cucumber/cucumber-js/issues/610

bsommardahl commented 8 years ago

According to the issue in the cucumberjs repo, this issue is present in v1.2.1 but not in previous issues. Could we downgrade cucumberjs to 1.2.0 until the issue is fixed?

alanning commented 8 years ago

I don't know how to actually do it but that sounds like a great workaround for now.

bsommardahl commented 8 years ago

Here's a PR: https://github.com/xolvio/chimp/pull/442

bsommardahl commented 8 years ago

@samhatoum I upgraded to Node v6.3.1 and got the same error. I'm pretty sure the problem is coming from cucumberjs v1.2.1 only.

samhatoum commented 8 years ago

Perhaps you could use a previous version of Chimp (v0.38.0) that used v1.0.0

bsommardahl commented 8 years ago

@samhatoum That's a good idea. I will likely have my team do that.

In the mean time, I just tried the version from #442 locally and my tests ran without issue!

samhatoum commented 8 years ago

oh that's great to know, I'll look into downgrading

Which version of node did you use when that worked?

bsommardahl commented 8 years ago

Working with chimp 0.38.0:

Fun fact, I was not able to install chimp@0.38.0 on Node 6.3.1 because of a module incompatibility.

Workaround achieved!

yann-stepienik-cko commented 8 years ago

@samhatoum @bsommardahl Issue in cucumber fixed in 1.2.2 Just need to be updated ! hurayy

2hansen commented 8 years ago

I am seeing the same issue with:

[chimp] Detected an unhandledRejection:
[chimp][hooks] TypeError: Cannot read property 'getFileName' of undefined
    at isFrameInCucumber 

after upgrading to chimp 0.39.3.

Upgrading cucumber to 1.2.2 does not seem to resolve this.

samhatoum commented 8 years ago

Fix coming shortly. Thanks for being patient

PierreCBSI commented 8 years ago

seeing the issue with chimp 0.40.4 edit as @jimmyhoneycutt experienced in #450, I'm getting weird errors on Ubuntu, meanwhile OSX is throwing the error itself. There is a fix for this issue suggested at https://gitter.im/cucumber/cucumber-js at Aug 11 03:57 by @philsrweb -

In the Cucumber JS code there is an assumption made in the file stack_trace_filter.js on line 9... var fileName = frame.getFileName() || ''; ... if you change it to a ternary as follows: var fileName = frame ? frame.getFileName() : ''; it works fine