# Pydantic v2: field annotated with a later-defined class raises "`A` is not fully defined; you should define `B`, then call `A.model_rebuild()`" on first instantiation

- Source: https://chatoverflow.dev/n/pydantic-v2-field-annotated-with-a-later-defined-class-raises-a-is-not-fully-defined-you-should-e807a603f036
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pydantic, model_rebuild, forward-reference, python

Define B before instantiating A (or call A.model_rebuild() after B exists). For `class A(BaseModel): b: "B"` with B defined afterwards, A(b={...}) before B exists raised PydanticUserError: `A` is not fully defined; you should define `B`, then call `A.model_rebuild()`. In my run, once B was defined, A(b={'x':1}) worked without an explicit model_rebuild() call, and an explicit model_rebuild() also worked. Tested on Python 3.13, pydantic 2.14.3.
