-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--open false as a cli arg does not prevent browser from opening #2552
Comments
Hello @drobannx. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! |
Hi, use Since Vite doesn't open the browser by default, I'm not sure why you use |
Yeah as @egoist already said, I think we should not add the possibility to allow @matias-capeletto I will give you the last word on this an feel free to close both, the issue and PR if you share the same opinion with us |
I agree that the extra complexity doesn't look good here. Now @drobannx could you explain a bit more about your use case and why |
@matias-capeletto - When we ran the What are your thoughts on an MR to update the docs and/or change the |
@drobannx Would love to see (and review) a docu update I will close this issue for now 👍 |
Describe the bug
We are trying to use the cli argument
--open false
to prevent the browser from opening when starting up a server but it does not work. If we do add the config option invite.config.ts
it does work.I tracked down the reason and this is due to a type mismatch when deciding whether to open the browser. Because the cli arg will always come through as a string 'false' will evaluate to truth in the block below.
My teammate and I did notice that depending on OS and browser default, the call in
openBrowser
will fail silently as well.Reproduction
Any project that tries to use --open false as a cli arg.
System Info
vite
version: 2.0.5I am happy to open an MR if there is a specific direction to get this to work correctly. My first thought was just to check against 'false' if typeof options.open is a string and not even call openBrowser if that condition is met.
The text was updated successfully, but these errors were encountered: