You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong TypeScript type used for fields when name collision exists between imported and nested messages #3025
proto-loader-gen-types fails to disambiguate between imported top-level types and nested messages with the same name. When this collision occurs, it incorrectly uses the nested type, omits the required import, and generates types that don't match the protobuf structure. This causes type errors and breaks IDE autocomplete for affected fields.
Reproduced with @grpc/proto-loader@0.7.12 and @grpc/proto-loader@0.8.0 on Ubuntu 22.04 on WSL2 (x86_64) with multiple 16+ Node versions. Node is installed using nvm
Additional context
Python and Go generators seem to handle this correctly:
Since the generated type name and import are consistent with each other, I would guess that this is a type name resolution error, rather than a code generation error.
Activity
murgatroid99 commentedon Nov 12, 2025
Since the generated type name and import are consistent with each other, I would guess that this is a type name resolution error, rather than a code generation error.