Skip to content
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

Crash when plugins event handler is undefined #4261

bahmutov opened this issue May 20, 2019 · 0 comments


2 participants
Copy link

commented May 20, 2019


Crashes in 3.2.0 and 3.3.0, have not tried earlier versions

Reproduction in

npm install
npm run cypress:open

and click on spec file


Register undefined event handler in plugins.js file for an event like

module.exports = (on, config) => {
  // `on` is used to hook into various events Cypress emits
  // `config` is the resolved Cypress config

and get the following crash

Screen Shot 2019-05-20 at 3 23 40 PM

Stack trace in the terminal

GET /__cypress/tests?p=cypress/support/index.js-383 200 8.371 ms - 146
TypeError: event.handler is not a function
    at invoke (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at /Users/gleb/Library/Caches/Cypress/3.3.0/
    at tryCatcher (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at Function.Promise.attempt.Promise.try (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at Object.wrapChildPromise (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at Object.wrap (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at execute (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at EventEmitter.ipc.on (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at emitThree (events.js:136:13)
    at EventEmitter.emit (events.js:217:7)
    at process.<anonymous> (/Users/gleb/Library/Caches/Cypress/3.3.0/
    at emitTwo (events.js:126:13)
    at process.emit (events.js:214:7)
    at emit (internal/child_process.js:772:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
GET /__cypress/tests?p=cypress/integration/spec.js-143 200 8.418 ms - 146

It would be nicer to have a much better error message here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.