Will It Vibe logoWill It Vibe?
FLASK-015Low severity-4 points

Deprecated @before_first_request hook

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

@app.before_first_request (or @blueprint.before_first_request) was deprecated in Flask 2.2 and removed entirely in Flask 2.3. Code that still defines it either pins an old Flask version or the hook already silently never runs.

Why it matters

before_first_request was deprecated in Flask 2.2 and removed completely in Flask 2.3. On any Flask version that still supports it, the hook only runs before the very first request the process handles, which is already a common source of surprising bugs (it never re-runs after a fork or a worker restart); on 2.3 and later the decorator does not exist at all and the app fails at import time.

How to fix it

Move the setup code out of before_first_request and run it directly at app creation time (module level or inside your app factory function, right after app = Flask(__name__)), which is the officially recommended replacement and runs deterministically once per process regardless of request timing.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks