You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
app.commandLine.getSwitchValue throws on uppercase letters #45991
35-x-ybug 🪲bug/regression ↩️A new version of Electron broke somethinghas-repro-gistIssue can be reproduced with code at https://gist.github.com/platform/all
[49418:0312/142211.150768:FATAL:command_line.cc(387)] Check failed: IsSwitchNameValid(switch_string).
/my_local_path/node_modules/electron/dist/electron exited with signal SIGTRAP
Windows (difference only in the exception handling):
[3392:0312/163241.720:FATAL:command_line.cc(387)] Check failed: IsSwitchNameValid(switch_string).
[3392:0312/163241.720:ERROR:crashpad_client_win.cc(869)] not connected
Thanks! Just to be clear: As far as I understand, commandLine exists to enable and disable Chromium switches. It's not supposed to replace process.argv.
Are there any Chromium switches that contain uppercase letters?
changed the title [-]app.commandLine.getSwitchValue throws on uppercase letters[/-][+]`app.commandLine.getSwitchValue` throws on uppercase letters[/+]on Mar 12, 2025
@nikwen Not that I know of, Chromium seems to use only kebab case for its switches. Though applications built on Electron can define their own custom switches – that's how I found out.
But yeah, it's definitely a minor issue, as we can use raw process.argv directly, which is the solution I used.
Maybe it was wrong to use app.commandLine.getSwitchValue for custom switches in the first place, as you indicate. Got it.
So then there is maybe no need to support uppercase chars... idk really, I just reported an undocumented change in observed behavior 🙂
35-x-ybug 🪲bug/regression ↩️A new version of Electron broke somethinghas-repro-gistIssue can be reproduced with code at https://gist.github.com/platform/all
Activity
nikwen commentedon Mar 12, 2025
Thanks for reporting! Is this limited to Linux or does it also happen on Windows or macOS?
Lemonexe commentedon Mar 12, 2025
@nikwen I've also reproduced it on Win 10 and updated the issue description accordingly 🙂
I do not have macOS available to confirm it also there.
nikwen commentedon Mar 12, 2025
Thanks! Just to be clear: As far as I understand,
commandLineexists to enable and disable Chromium switches. It's not supposed to replaceprocess.argv.Are there any Chromium switches that contain uppercase letters?
[-]app.commandLine.getSwitchValue throws on uppercase letters[/-][+]`app.commandLine.getSwitchValue` throws on uppercase letters[/+]Lemonexe commentedon Mar 12, 2025
@nikwen Not that I know of, Chromium seems to use only kebab case for its switches. Though applications built on Electron can define their own custom switches – that's how I found out.
But yeah, it's definitely a minor issue, as we can use raw
process.argvdirectly, which is the solution I used.Maybe it was wrong to use
app.commandLine.getSwitchValuefor custom switches in the first place, as you indicate. Got it.So then there is maybe no need to support uppercase chars... idk really, I just reported an undocumented change in observed behavior 🙂
nikwen commentedon Mar 12, 2025
We talked internally and everyone agreed that
app.commandLineis meant for customizing Chromium arguments, not application-specific parameters.Still, @codebytere said she'd change the code to at least prevent it from crashing.