#17031·streamlit

A config that sets server.port raises at config parse and blocks startup on a dev-mode (non-site-packages) install

Author: richardparslow-commitsCreated Sep 18, 2026Updated Sep 27, 2026
Labelstype:bugstatus:confirmedpriority:P3feature:configarea:serverarea:backend

Summary

Setting server.port raises out of config parsing and blocks startup when Streamlit considers itself a development install, and the message does not say how to proceed.

streamlit/config.py defines global.developmentMode as true whenever the package is not under a site-packages directory ("site-packages" not in __file__ — so a source checkout, pip install -e, or a vendored/--target install), and _check_conflicts() then raises:

RuntimeError: server.port does not work when global.developmentMode is true.

The raise looks deliberate — in dev mode the Node server hard-codes 8501, which is what the comment above the check explains — so this is a question about the failure mode rather than a claim that the check itself is wrong. Two things make it awkward from an application author's side:

  1. A committed config value is enough. An app that ships [server] port = ... in its .streamlit/config.toml (a normal thing to pin for a deployment) cannot start at all on a dev-mode install, and the author may never have intended that value for this environment.
  2. The error does not name a way forward. It says why the port does not work, not what to do about it. The escape hatch (below) is not discoverable from the message.

Steps to reproduce

Self-contained; pip install --target is just a convenient way to get a non-site-packages install.

bash
WORK=/tmp/streamlit-devmode-repro
python3 -m pip install --quiet --target "$WORK/pkgs" "streamlit==1.64.0"
mkdir -p "$WORK/app/.streamlit"
printf '[server]\nport = 9999\n' > "$WORK/app/.streamlit/config.toml"
cd "$WORK/app"

# 1. Any library use that parses config
PYTHONPATH="$WORK/pkgs" python3 -c "import streamlit.config as c; c.get_config_options()"
# RuntimeError: server.port does not work when global.developmentMode is true.

# 2. The CLI
PYTHONPATH="$WORK/pkgs" python3 -m streamlit config show
# same RuntimeError

# 3. Even with no port in any config file:
PYTHONPATH="$WORK/pkgs" python3 -m streamlit config show --server.port 8502
# same RuntimeError

All three exit 1. With a config that sets no port, the same install parses fine (server.port = 8501).

Expected behavior

One of:

  • warn and ignore the configured port (nothing needs it in dev mode, and the server uses 8501 regardless), or
  • raise only for the port the server would actually use, and have the message name the escape hatch, e.g. "remove server.port from .streamlit/config.toml, or run with --global.developmentMode false".

Actual behavior

A hard RuntimeError from get_config_options(), before any app code runs, for any source of the value: a project or machine config file, or the documented --server.port flag.

Is this new?

The same on 1.63.0 and 1.64.0 (in 1.63 the check sits at the end of streamlit/config.py, reached via _on_config_parsed). I have not checked further back.

Workarounds (both verified)

  • streamlit run app.py --global.developmentMode false — per run.
  • [global] developmentMode = false in a config file — persistent, but it is a hidden option and it also turns off dev-mode conveniences (e.g. logger.level defaulting to debug).

Environment

  • Streamlit 1.63.0 and 1.64.0
  • Python 3.13.14
  • macOS 27.0 (arm64)