0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

FastAPIでホットリロードができない貴兄に

Posted at

FastAPIでホットリロードがなぜかできなくなっちゃったとお嘆きの貴兄。

image.png

こんなエラーが出ていませんか?

_rust_notify.WatchfilesRustInternalError: error in underlying watcher: IO error for operation on <path>: No such file or directory (os error 2)

これです。
ググったら以下がありまして、

Downgrading watchfiles to version 0.21.0 solved the issue for me.

とのことでした。とりあえずこれで凌ぎましょう。

[tool.poetry.dependencies]
python = "^3.11"
fastapi = "^0.112.1"
uvicorn = {extras = ["standard"], version = "^0.30.6"}
sqlalchemy = "^2.0.32"
pymysql = "^1.1.1"
watchfiles = "0.21.0"

このようにpyproject.tomlに

watchfiles = "0.21.0"

を追加して

$ docker-compose run --entrypoint "poetry install --no-root" demo-app

Package operations: 0 installs, 1 update, 0 removals
 - Downgrading watchfiles (0.23.0 -> 0.21.0) 

ダウングレードできました。
これでさきほどのエラーは出なくなりました。ホットリロードもされるようになりました。
よかったですね、貴兄。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?