fix(core): fix docusaurus start error for macOS users with no Chromium-based browser (#11205)

This commit is contained in:
Sébastien Lorber 2025-05-27 17:13:32 +02:00 committed by GitHub
parent 76518fd206
commit 68aa3c876b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,7 +70,14 @@ async function tryOpenWithAppleScript({
const command = `ps cax -o command | grep -E "^(${supportedChromiumBrowsers.join(
'|',
)})$"`;
const result = await execPromise(command);
const result = await execPromise(command).catch(() => {
// Ignore grep errors when macOS user has no Chromium-based browser
// See https://github.com/facebook/docusaurus/issues/11204
});
if (!result) {
return [];
}
const activeBrowsers = result.stdout.toString().trim().split('\n');