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
Vite feature to open running instance of Chrome browsers doesn't fail immediately when Chrome is not running (openedBrowser is undefined), instead MacOS system dialog "Choose Application" - "Where is undefined?" is displayed. Only after closing this dialog, exception is thrown and catched in script and continue to opening new Google Chrome instance.
Please don't execute osascript with undefined openedBrowser or use value from preferredOSXBrowser when openedBrowser is undefined. https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/openBrowser.ts#L93
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
I just narrowed down this issue to Vite as well, in my SvelteKit project. Firefox is my browser of choice and is always running when I start my application, so this issue title should remove everything after "application."
Describe the bug
Vite feature to open running instance of Chrome browsers doesn't fail immediately when Chrome is not running (openedBrowser is undefined), instead MacOS system dialog
"Choose Application" - "Where is undefined?"
is displayed. Only after closing this dialog, exception is thrown and catched in script and continue to opening new Google Chrome instance.Please don't execute osascript with undefined openedBrowser or use value from preferredOSXBrowser when openedBrowser is undefined.
https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/openBrowser.ts#L93
Reproduction
https://stackblitz.com/edit/vitejs-vite-hntcyg?file=package.json
Steps to reproduce
vite 3.2.5
be sure there is no running process 'Google Chrome'
execute command:
BROWSER="Google Chrome" vite
MacOS system dialog
"Choose Application" - "Where is undefined?"
is displayed because vite execute:osascript openChrome.applescript http://127.0.0.1:8080/index.html undefined
https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/openBrowser.ts#L93
System Info
System: OS: macOS 12.6 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.2 npm: 8.5.0 Browsers: Chrome: 107.0.5304.121 Firefox: 106.0.2 Safari: 16.0 npmPackages: vite: ^3.2.5 => 3.2.5
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: