diff --git a/esphome/build_helpers/pch.py b/esphome/build_helpers/pch.py index f9138a3a9b..4e74333f19 100644 --- a/esphome/build_helpers/pch.py +++ b/esphome/build_helpers/pch.py @@ -317,7 +317,7 @@ def prepare_pch( cmd_id, ), ) - except OSError as err: + except (OSError, UnicodeError) as err: # Identity unknown: a stale cache entry must never be served _LOGGER.warning( "Could not establish the pch identity; compiling without it: %s", err