I am trying to follow the "Beware the Nest o’ Pirates" tutorial https://www.dartlang.org/codelabs/server/ and have hit a problem when I try to generate the client code for the PiratesApi
When I run the command
pub global run rpc:generate client -i lib/server/piratesapi.dart -o lib/client
I get the following error message
Failed executing command 'discoveryWithImports' with error:
No constructor 'ApiParser' with matching arguments declared in class 'ApiParser'.
NoSuchMethodError: incorrect number of arguments passed to method named 'ApiParser'
Receiver: Type: class 'ApiParser'
Tried calling: ApiParser(strict: true)
Found: ApiParser()
What does that error message mean?
Try activating the rpc package with a version constraint:
https://www.dartlang.org/tools/pub/cmd/pub-global.html