Skip to content

FLASK_DEBUG env variable no longer works as of click 8.4.0 #6025

Closed

Description

@crono782

Description of bug:

FLASK_DEBUG=1 was working previously to set flask's debug mode either in a .env/.flaskenv and using python-dotenv OR by manually setting with export FLASK_DEBUG=1. As of today, setting it by env variable no longer works. Flask will still use debug mode using the --debug flag. Downgrading click to 8.3.3 resolves the issue.

Replicate bug:

python3 -m venv venv
. venv/bin/activate
pip install flask
cat << EOF > app.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
    return 'hello world'
EOF
export FLASK_DEBUG=1
flask run

This produces:

Debug mode: off

pip install click==8.3.3
flask run

Then produces:

Debug mode: on

Environment:

  • Python version: 3.12.3
  • Flask version: 3.1.3

Activity

  1. davidism commented on May 21, 2026

    @davidism
    Member

    This will be fixed in Click 8.4.1, see pallets/click#3484. Closing to avoid more AI generated junk PRs in the meantime.

  2. davidism commented on May 22, 2026

    @davidism
    Member

    Click 8.4.1 is released and fixes this.

  3. locked as resolved and limited conversation to collaborators on Jul 31, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions