Fix type error when `main` field points to a dir