# proto: unable to resolve "type.googleapis.com/pb.Payment"

- **ID:** `go/proto-any-unmarshal-type-not-found`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

protojson or proto.Unmarshal encountered an Any message whose embedded type URL is not registered in the global type registry.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| google.golang.org/protobuf v1.30+ | active | — | — |

## Workarounds

1. **** (93% success)
   ```
   import _ "example.com/project/pb" // triggers init() registration
// or explicit:
protoregistry.GlobalTypes.RegisterMessage(paymentpb.Payment{}.ProtoReflect().Type())
   ```
2. **** (88% success)
   ```
   opts := protojson.UnmarshalOptions{
    Resolver: protoregistry.GlobalTypes,
}
if err := opts.Unmarshal(data, msg); err != nil {
    return err
}
   ```

## Dead Ends

- **** — Any.Value contains a serialized message with a type prefix; direct assignment yields garbage. (95% fail)
- **** — Works only if the caller knows the type; defeats the purpose of Any and breaks polymorphic dispatch. (60% fail)
