Jump to solution
Details

The Fix

Upgrade to version 0.11.4 or later.

Based on closed Kludex/uvicorn issue #320 · PR/commit linked

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Open PR/Commit
@@ -41,11 +41,11 @@ def get_packages(package): requirements = [ - "click", - "h11", - "websockets>=6.0",
fix.md
Option A — Upgrade to fixed release\nUpgrade to version 0.11.4 or later.\nWhen NOT to use: This fix is not applicable if the application relies on features from Click versions lower than 7.\n\n

Why This Fix Works in Production

  • Trigger: TypeError: __init__() when run "uvicorn app:App"
  • Mechanism: The TypeError occurs due to an incompatible version of the Click library being used
  • Why the fix works: Pins the dependencies to their latest major-point releases, resolving the TypeError encountered when running uvicorn. (first fixed release: 0.11.4).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Shows up under Python 3.7.2 in real deployments (not just unit tests).
  • The TypeError occurs due to an incompatible version of the Click library being used
  • Surfaces as: TypeError: __init__() when run "uvicorn app:App"

Proof / Evidence

  • GitHub issue: #320
  • Fix PR: https://github.com/kludex/uvicorn/pull/324
  • First fixed release: 0.11.4
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.85
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.42

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“> Not sure why we'd want to hide --debug from --help Because —reload is what we want to recommend”
@lovelydinosaur · 2019-03-10 · source
“Ah right, I didn't realise it was the example app from the quickstart”
@florimondmanca · 2019-03-09 · repro detail · source
“Cool! I've tried using click==6.7 and I was able to reproduce this bug”
@florimondmanca · 2019-03-09 · source
“@adriangallegos Not a maintainer, but I think providing a minimum example application and full command listing allowing to reproduce this error would help people to…”
@florimondmanca · 2019-03-09 · source

Failure Signature (Search String)

  • TypeError: __init__() when run "uvicorn app:App"

Error Message

Stack trace
error.txt
Error Message ------------- TypeError: __init__() when run "uvicorn app:App"
Stack trace
error.txt
Error Message ------------- Traceback (most recent call last):\n File "/usr/local/bin/uvicorn", line 11, in <module>\n load_entry_point('uvicorn==0.5.1', 'console_scripts', 'uvicorn')()\n File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point\n return get_distribution(dist).load_entry_point(group, name)\n File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point\n return ep.load()\n File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load\n return self.resolve()\n File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve\n module = __import__(self.module_name, fromlist=['__name__'], level=0)\n File "/usr/local/lib/python3.7/site-packages/uvicorn/__init__.py", line 2, in <module>\n from uvicorn.main import Server, main, run\n File "/usr/local/lib/python3.7/site-packages/uvicorn/main.py", line 212, in <module>\n ssl_ciphers: str,\n File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 170, in decorator\n _param_memo(f, OptionClass(param_decls, **attrs))\n File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1460, in __init__\n Parameter.__init__(self, param_decls, type=type, **attrs)

Environment

  • Python: 3.7.2

What Broke

Users encounter a TypeError when trying to run the application with Uvicorn.

Why It Broke

The TypeError occurs due to an incompatible version of the Click library being used

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

Upgrade to version 0.11.4 or later.

When NOT to use: This fix is not applicable if the application relies on features from Click versions lower than 7.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/kludex/uvicorn/pull/324

First fixed release: 0.11.4

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if the application relies on features from Click versions lower than 7.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Add a TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
  • Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.

Version Compatibility Table

VersionStatus
0.11.4 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.