Skip to content

Flutter 3.38 run command line arguments not working for web development config #179014

Closed

Description

@GreatTux

From 3.38 it is not possible to pass in the command line the following parameters:

  • web-hostname
  • web-port
  • web-tls-cert-path
  • web-tls-cert-key-path

This issue has been introduced by this PR: #172175

The implementation document states:

  1. Configuration Precedence
    A small but critical section to prevent user confusion, explicitly stating the override order:
    Command-Line Arguments (e.g., --web-port)
    web_dev_config.yaml settings
    Built-in default values

The flutter documentation for this feature ](https://docs.flutter.dev/platform-integration/web/web-dev-config-file) also specifies:

Configuration precedence

Remember the order of precedence for settings:

Command-line arguments (such as --web-hostname, --web-port)
web_dev_config.yaml settings
Built-in default values

And (some) of the command line arguments are still available in flutter run -h

--web-tls-cert-path                                      The certificate that host will use to serve using TLS connection. If not provided, the tool will use default http scheme.
--web-tls-cert-key-path                                  The certificate key that host will use to authenticate cert. If not provided, the tool will use default http scheme.

But regardless of the above, the implementation now ignores command line arguments and fully relies on the newly introduced web_dev_config.yaml.

Activity

  1. darshankawar commented on Nov 25, 2025

    @darshankawar
    Member

    Thanks for the report. Keeping the issue open for team's tracking.

  2. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-webWeb applications specifically
    team-webOwned by Web platform team
    fyi-toolFor the attention of Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Nov 25, 2025
  3. added
    P2Important issues not at the top of the work list
    triaged-webTriaged by Web platform team
    on Dec 3, 2025
  4. fayzan101 commented on Dec 9, 2025

    @fayzan101

    From Flutter 3.38, the behavior of web dev server configuration no longer matches the documented precedence. The design doc and https://docs.flutter.dev/platform-integration/web/web-dev-config-file both say: (1) CLI flags (--web-hostname, --web-port, --web-tls-cert-path, --web-tls-cert-key-path), (2) web_dev_config.yaml, (3) built‑in defaults. In practice, the tool now always loads web_dev_config.yaml and uses those values even when the same options are passed on the command line. This effectively makes the CLI flags non‑functional whenever web_dev_config.yaml is present. For example, flutter run -d chrome --web-port=1234 --web-hostname=localhost still binds to the host/port from web_dev_config.yaml. The implementation in WebDevServerConfig.loadFromFile + copyWith should treat the YAML file as the base and overlay any non‑null CLI arguments on top. That is, fileConfig = loadFromFile(...) should be followed by something like fileConfig.copyWith(host: stringArg('web-hostname'), port: webPort, https: httpsConfig, headers: extractWebHeaders()). This would restore the documented precedence: CLI > config file > defaults. Right now there is a mismatch between docs/design and actual behavior, and it’s a breaking change for setups that depended on runtime CLI overrides (e.g. CI, scripts).

  5. kevmoo commented on Dec 12, 2025

    @kevmoo
    Contributor

    The in-flight PR from @Saqib198 looks like it has a fix! I'll baby site to make sure it lands

  6. added a commit that references this issue on Jan 6, 2026
    fb86531
  7. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jan 7, 2026
  8. github-actions commented on Jan 21, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfyi-toolFor the attention of Flutter Tool teamplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions