question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--config-file param not working with this plugin

See original GitHub issue

Hey there,

I figured out that the --config-file parameter isn’t working anymore with this plugin. The following exception shows that this plugin tries to determine the location of the step definitions and fails because nodejs’s path.join method expected a String rather than a Boolean.

My execution command: ./node_modules/.bin/cypress run --config-file "config/cypress/cypress.json"

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type boolean
    at validateString (internal/validators.js:105:11)
    at Object.resolve (path.js:978:7)
    at module.exports (/var/www/thunder/web-order/node_modules/cypress-cucumber-preprocessor/lib/stepDefinitionPath.js:11:14)
    at getStepDefinitionsPaths (/var/www/thunder/web-order/node_modules/cypress-cucumber-preprocessor/lib/getStepDefinitionsPaths.js:15:38)
    at module.exports (/var/www/thunder/web-order/node_modules/cypress-cucumber-preprocessor/lib/loader.js:25:36)
    at Stream.end (/var/www/thunder/web-order/node_modules/cypress-cucumber-preprocessor/lib/index.js:25:18)
    at _end (./node_modules/through/index.js:65:9)
    at Stream.stream.end (./node_modules/through/index.js:74:5)
    at DestroyableTransform.onend (./node_modules/readable-stream/lib/_stream_readable.js:577:10)
    at Object.onceWrapper (events.js:282:20)
    at DestroyableTransform.emit (events.js:199:15)
    at endReadableNT (./node_modules/readable-stream/lib/_stream_readable.js:1010:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)

I looked into the file cypressExecutionInstance.js and checked the result of ps-node’s lookup function. It returns the the arguments in the wrong order and this leads to wrong value assignment and the --config-file argument is considered as flag (boolean).

[ { pid: '3714',
    command: '/home/fragsalat/.cache/Cypress/3.6.1/Cypress/Cypress',
    arguments:
     [ '--run-project',
       '--config-file',
       '--cwd',
       '--no-sandbox',
       '/path/to/app',
       'config/cypress/cypress.json',
       '/path/to/app' ],
    ppid: '3544' } ]

This results in the following config

{ _:
   [ '/path/to/project',
     'config/cypress/cypress.json',
     '/path/to/project' ],
  'run-project': true,
  'config-file': true,
  cwd: true,
  sandbox: false }

I could open the bug also in ps-node I guess but may you find a better alternative to get the process arguments. Thanks upfront for looking into this and for your work on this plugin 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lgandeckicommented, Dec 11, 2019

yup! quite a lot of people using this small library, so I want to make sure I can’t break the new version even if I try 😉

0reactions
fragsalatcommented, Jan 23, 2020

Confirmed! Thank you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

config-file param not working with this plugin #283 - GitHub
Hey there,. I figured out that the --config-file parameter isn't working anymore with this plugin. The following exception shows that this ...
Read more >
python - Config parameter not reading from other locations
@Evgeny Pogrebnyak I'm attempting to read a configuration file property from any location in python project, but it appears can just read from ......
Read more >
[JENKINS-14977] Parameter type to select config file
Jenkins "Config File Provider" Plugin allows to store in Jenkins config different configuration files(maven,groovy,custom xml).
Read more >
Invalid config file! - Unspecified intellij internal parameter: user ...
Hello I have ubuntu 18.10 and latest Webstorm. I fixed that problem by modifying plugin source code. You can find file /home/$USER/.Apps/ ...
Read more >
Extending the Cypress Config File
In this blog post I will show how to implement extends syntax in the Cypress JSON configuration file without waiting for the Cypress...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found