fix: default server_name to 127.0.0.1 and add show_error to launch() - #4186
Open
rioayumi wants to merge 1 commit into
Open
fix: default server_name to 127.0.0.1 and add show_error to launch()#4186rioayumi wants to merge 1 commit into
rioayumi wants to merge 1 commit into
Conversation
When --listen is not specified, server_name was passed as None, which causes Gradio to fail with "When localhost is not accessible, a shareable link must be created" on some macOS / proxy configurations. Defaulting to "127.0.0.1" ensures the server always binds to loopback when no explicit listen address is provided. Also adds show_error=True to surface Gradio-level errors in the UI rather than silently failing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--listenis not specified,server_namewas passed asNonetogradio_root.launch(), causing Gradio to raise "When localhost is not accessible, a shareable link must be created" on some macOS environments with restrictive network/proxy settings.server_nameto"127.0.0.1"whenargs.listenis falsy, so the server always binds to loopback when no explicit listen address is provided.show_error=Trueto surface Gradio-level errors in the browser UI instead of silently failing.Test plan
--listenflag on macOS — UI should open athttp://127.0.0.1:7865--listen 0.0.0.0— existing behaviour unchanged🤖 Generated with Claude Code