Uncaught TypeError: Parser is not a constructor
See original GitHub issueHi
Thanks for the plugin, we would really like to use it for our project. Unfortunately it does not seem to be working for us.
We have cypress set up and can run tests fine, but when we add in a .feature
file the tests fail to run with an error:
Uncaught TypeError: Parser is not a constructor
Digging into it, it seems to be coming from here: https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/blob/master/lib/loader.js#L18 I have added some console logs and can see that the gherkin module is empty when this code runs.
I have tried installing the gherkin dependency in my own project, this then results in a different error:
Error: Cannot find module 'cucumber-messages/node_modules/protobufjs' from '/Users/...my_project.../node_modules/gherkin/dist/src'
Node version is 9.11.1 npm version 6.4.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
Hi, I am Jamie’s colleague. So it looks like for some reason we needed to install gherkin as a dependency, despite the fact that I did not need to do so in the example app. We needed to make sure that the Gherkin version matched the one the preprocessor is expecting, and everything seems to be okay.
I’d suggest closing this ticket.
Thanks for your hard work!
coolio, great and thanks for coming back to us. Someone might hit this solution now through googling 😃 Not much we can do about this, probably one of your existing dependencies somehow depends on a gherkin internally, but on a different version, and then something like this happens? hard to say.
Thanks again and please let us know if you need help with anything else!