Skip to content

remote-debugging-port cannot be set using ELECTRON_EXTRA_LAUNCH_ARGS #7994

Closed
@dg-nvm

Description

@dg-nvm

Current behavior:

When set ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port 40500 is used then nothing happens

BUT

When I change environment.js to use appendSwitch instead, it works:

app.commandLine.appendSwitch('remote-debugging-port', '40500')

Desired behavior:

I can set option via environment variable

Test code to reproduce

set ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port 40500
cypress open

Cypress should output:
DevTools listening on ws://127.0.0.1:40500/devtools/browser/<UUID>

Versions

Windows 10, Cypress 4.10.0, using builtin Electron in Headed mode

Activity

jennifer-shehane

jennifer-shehane commented on Jul 16, 2020

@jennifer-shehane
Member

Yeah, I don't think we are handling key value pairs correctly in our ELECTRON_EXTRA_LAUNCH_ARGS here. Electron says we need to call the argument like app.commandLine.appendSwitch('remote-debugging-port', '8315'), but I don't see us actually pulling out the value from the key in order to pass these as 2 arguments to appendSwitch. https://www.electronjs.org/docs/api/command-line-switches

The code that handles this is here: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/environment.js#L71:L71

The test shows it's being called as --remote-debugging-port=40500.

I don't think that appendArgument actually supports key value pairs, the Electron docs even suggest using appendSwitch here instead. https://www.electronjs.org/docs/api/command-line#commandlineappendargumentvalue

jennifer-shehane

jennifer-shehane commented on Jul 16, 2020

@jennifer-shehane
Member

Opened a PR here #8001

dg-nvm

dg-nvm commented on Jul 16, 2020

@dg-nvm
Author

@jennifer-shehane thank you Jennifer for fast reaction. These two differs greatly internally and also they mention added cmdline will be added before switches.

cypress-bot

cypress-bot commented on Jul 16, 2020

@cypress-bot
Contributor

The code for this is done in cypress-io/cypress#8001, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @jennifer-shehane@dg-nvm

    Issue actions

      remote-debugging-port cannot be set using ELECTRON_EXTRA_LAUNCH_ARGS · Issue #7994 · cypress-io/cypress