Skip to content

Fix Chrome paths with spaces#770

Open
neeeeecka wants to merge 1 commit intoprerender:masterfrom
neeeeecka:master
Open

Fix Chrome paths with spaces#770
neeeeecka wants to merge 1 commit intoprerender:masterfrom
neeeeecka:master

Conversation

@neeeeecka
Copy link
Copy Markdown

@neeeeecka neeeeecka commented Oct 12, 2023

The issue:

On MacOs the Chrome would not start, shell command ran but exited:
image

The reason:

The backslashes in - /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome are not interpreted as literal characters by JS, but rather ignored and the resulting JS string was: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome.

Fix:

To resolve this, we need to escape whitespaces as we would escape them in a shell command, by wrapping it in double quotes:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

Related: nodejs/node#7367 (comment)

Tested on:
MacOS: 13.2.1
NodeJS: v14.21.3

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant