FastAPI SPA broke because a linter rename mismatched a path parameter name
A developer's single-page application fallback began returning 422 errors on all non-root routes after a linter suggested prefixing an unused parameter with an underscore, changing 'full_path' to '_full_path'. Because FastAPI injects path parameters by matching function argument names to the path template exactly, the mismatch caused it to search for the value as a query string instead, finding nothing and failing. A separate bug involved a port conflict in a monorepo, where two services raced to bind port 8765 on startup and the dashboard process lost silently, requiring a move to port 8766. Both issues were resolved with single-character or single-digit fixes, but only after time-consuming debugging sessions. The author concluded that linter suggestions should not be applied blindly at framework boundaries, and that a shared port registry document would have prevented the second issue entirely.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in