Skip to content
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 default browser loop #141

Open
johnnesky opened this issue Jul 16, 2024 · 0 comments
Open

Open default browser loop #141

johnnesky opened this issue Jul 16, 2024 · 0 comments

Comments

@johnnesky
Copy link

johnnesky commented Jul 16, 2024

If I run five-server with the open arg in a context where no web browser is available (a remote headless ubuntu server), the result is an infinite loop of printing out:

Could not open browser "default". Trying the default browser next.

Of course I could just set the open arg to false, but if I have a package.json file with an npm script designed to run on an end-user machine, and I happen to run this same script from a headless remote machine, it would be nice if it didn't have an infinite loop and just gave up more gracefully.

In my case, I would prefer that five-server continues to serve the content even in the event that it fails to open a browser, maybe with a warning message printing out the intended URL so that you could copy and paste it to manually open a browser, so that I could use the same script in both contexts. But I suppose that ending the job with an error code would be a reasonable behavior too unless open is set to false.

EDIT: I ended up setting up my script so that I could pass a "--headless" argument to it to control whether it opens a browser, and I'm satisfied with that, so don't worry about me. But still, the infinite loop isn't a good experience and should probably be addressed.

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

No branches or pull requests

1 participant