VSCode git pre-push hook triggers: bad option: --no-sandbox
See original GitHub issueCurrent behavior:
When pre-push hook trigger via VSCode build-in git extension, we have the following error:
2020-06-11T14:33:53.786Z cypress:cli:cli cli starts with arguments ["/Users/xx/.nvm/versions/node/v10.16.0/bin/node","/Users/xx/repos/xxx/node_modules/xxxx/node_modules/.bin/cypress","run","--headless","--browser","chrome"]
2020-06-11T14:33:53.787Z cypress:cli NODE_OPTIONS is not set
2020-06-11T14:33:53.788Z cypress:cli:cli program parsing arguments
2020-06-11T14:33:53.793Z cypress:cli:cli running Cypress with args [ Command { commands: [], options: [ [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option] ], _execs: Set {}, _allowUnknownOption: false, _args: [], _name: 'run', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _helpFlags: '-h, --help', _helpDescription: 'output usage information', _helpShortFlag: '-h', _helpLongFlag: '--help', _noHelp: false, _exitCallback: undefined, _executableFile: undefined, parent: Command { commands: [Array], options: [Array], _execs: Set {}, _allowUnknownOption: false, _args: [], _name: 'cypress', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _helpFlags: '-h, --help', _helpDescription: 'output usage information', _helpShortFlag: '-h', _helpLongFlag: '--help', _usage: '<command> [options]', _events: [Object], _eventsCount: 9, rawArgs: [Array], args: [] }, _usage: '[options]', _description: 'Runs Cypress tests from the CLI without the GUI', _argsDescription: undefined, _events: [Object: null prototype] { 'option:browser': [Function], 'option:ci-build-id': [Function], 'option:config': [Function], 'option:config-file': [Function], 'option:env': [Function], 'option:group': [Function], 'option:key': [Function], 'option:headed': [Function], 'option:headless': [Function], 'option:no-exit': [Function], 'option:parallel': [Function], 'option:port': [Function], 'option:project': [Function], 'option:record': [Function], 'option:reporter': [Function], 'option:reporter-options': [Function], 'option:spec': [Function], 'option:tag': [Function], 'option:dev': [Function] }, _eventsCount: 19, exit: true, headless: true, browser: 'chrome' } ]
2020-06-11T14:33:53.961Z cypress:cli:cli variable-length opts parsed { args: [ '/Users/xx/.nvm/versions/node/v10.16.0/bin/node', '/Users/xx/repos/xxx/node_modules/xxxx/node_modules/.bin/cypress', 'run', '--headless', '--browser', 'chrome' ], opts: Command { commands: [], options: [ [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option], [Option] ], _execs: Set {}, _allowUnknownOption: false, _args: [], _name: 'run', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _helpFlags: '-h, --help', _helpDescription: 'output usage information', _helpShortFlag: '-h', _helpLongFlag: '--help', _noHelp: false, _exitCallback: undefined, _executableFile: undefined, parent: Command { commands: [Array], options: [Array], _execs: Set {}, _allowUnknownOption: false, _args: [], _name: 'cypress', _optionValues: {}, _storeOptionsAsProperties: true, _passCommandToAction: true, _actionResults: [], _helpFlags: '-h, --help', _helpDescription: 'output usage information', _helpShortFlag: '-h', _helpLongFlag: '--help', _usage: '<command> [options]', _events: [Object], _eventsCount: 9, rawArgs: [Array], args: [] }, _usage: '[options]', _description: 'Runs Cypress tests from the CLI without the GUI', _argsDescription: undefined, _events: [Object: null prototype] { 'option:browser': [Function], 'option:ci-build-id': [Function], 'option:config': [Function], 'option:config-file': [Function], 'option:env': [Function], 'option:group': [Function], 'option:key': [Function], 'option:headed': [Function], 'option:headless': [Function], 'option:no-exit': [Function], 'option:parallel': [Function], 'option:port': [Function], 'option:project': [Function], 'option:record': [Function], 'option:reporter': [Function], 'option:reporter-options': [Function], 'option:spec': [Function], 'option:tag': [Function], 'option:dev': [Function] }, _eventsCount: 19, exit: true, headless: true, browser: 'chrome' } }
2020-06-11T14:33:53.962Z cypress:cli parsed cli options { browser: 'chrome', headless: true }
2020-06-11T14:33:53.963Z cypress:cli verifying Cypress app
2020-06-11T14:33:53.964Z cypress:cli checking environment variables
2020-06-11T14:33:53.968Z cypress:cli checking if executable exists /Users/xx/Library/Caches/Cypress/4.7.0/Cypress.app/Contents/MacOS/Cypress
2020-06-11T14:33:53.970Z cypress:cli Binary is executable? : true
2020-06-11T14:33:53.970Z cypress:cli binaryDir is /Users/xx/Library/Caches/Cypress/4.7.0/Cypress.app
2020-06-11T14:33:53.971Z cypress:cli Reading binary package.json from: /Users/xx/Library/Caches/Cypress/4.7.0/Cypress.app/Contents/Resources/app/package.json
2020-06-11T14:33:53.974Z cypress:cli Found binary version 4.7.0 installed in: /Users/xx/Library/Caches/Cypress/4.7.0/Cypress.app
2020-06-11T14:33:53.975Z cypress:cli { verified: true }
2020-06-11T14:33:53.975Z cypress:cli is Verified ? true
2020-06-11T14:33:53.976Z cypress:cli:run processing run options { browser: 'chrome', headless: true, key: null, spec: null, reporter: null, reporterOptions: null, project: '/Users/xx/repos/xxx' }
2020-06-11T14:33:53.976Z cypress:cli:run --key is not set, looking up environment variable CYPRESS_RECORD_KEY
2020-06-11T14:33:53.976Z cypress:cli:run run to spawn.start args ["--run-project","/Users/xx/repos/xxx","--browser","chrome","--headed",false]
2020-06-11T14:33:53.976Z cypress:cli needs to start own Xvfb? false
2020-06-11T14:33:53.977Z cypress:cli spawning, should retry on display problem? false
2020-06-11T14:33:53.983Z cypress:cli spawning Cypress with executable: /Users/xx/Library/Caches/Cypress/4.7.0/Cypress.app/Contents/MacOS/Cypress
2020-06-11T14:33:53.984Z cypress:cli spawn args [ '--no-sandbox', '--', '--run-project', '/Users/xx/repos/xxx', '--browser', 'chrome', '--headed', false, '--cwd', '/Users/xx/repos/xxx' ] { detached: false, stdio: [ 'inherit', 'inherit', 'pipe' ] }
2020-06-11T14:33:53.988Z cypress:cli piping child STDERR to process STDERR
/Users/xx/Library/Caches/Cypress/4.7.0/Cypress.app/Contents/MacOS/Cypress: bad option: --no-sandbox
2020-06-11T14:33:57.094Z cypress:cli child event fired { event: 'exit', code: 9, signal: null }
2020-06-11T14:33:57.094Z cypress:cli child event fired { event: 'close', code: 9, signal: null }
npm ERR! code ELIFECYCLE
(I marked some folder name to be 'x’s intentionally)
Desired behavior:
It should run Cypress test as it was trigger by git cli.
Test code to reproduce
Versions
Cypress: 4.7.0 MacOs: 10.14.5 Node Version: 10.16.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:13 (4 by maintainers)
Top Results From Across the Web
The hook `black` requires pre-commit version 2.9.2 but ...
The following error pops up whenever I use the commit button / press ctrl + enter in visual studio code. VS Code -...
Read more >githooks Documentation - Git
An exception are hooks triggered during a push (pre-receive, update, post-receive, post-update, push-to-checkout) which are always executed in $GIT_DIR.
Read more >Introduction to collision - Unity - Manual
A collider configured as a Trigger (using the Is Trigger property) does not behave as a solid object and will simply allow other...
Read more >Changelog — Python 3.11.1 documentation
Fix incorrect check which allowed more than one varargs in clinic.py. Fix miscalculation of noptargs in generated code. Do not generate noptargs when...
Read more >Nixpkgs 22.11 manual - NixOS
Because overlays that are set in NixOS configuration do not affect non-NixOS operations such as nix-env , the overlays.nix option provides a convenient...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also have this issue in
downshift
. We have a cypress test run in the pre-commit hook. It happens when I commit from VSCode.Let me know if I can provide more info.
I have the same exact issue with the same error while using precommit hook. Any potential fix or reason why this might be happening?
Edit: this only happens while using the Git extension GUI that comes with VSCode to commit like someone mentioned. If I use the command line it works fine.