For Java, registering an entity:
new AkkaServerless() .registerEventSourcedEntity( ShoppingCartEntity.class, ShoppingCartApi.getDescriptor().findServiceByName("ShoppingCartService"), ShoppingCartDomain.getDescriptor())
With both language implementations, the link between the code and the protobuf happens at run time. Therefore any misalignment problems are not found until runtime.
Ideally, this should be done at compile time. Even with JS there are tools that would help to surface issues before running the code.