Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native - Parsing Server Error Response gives "missing trailer" #2135

Open
anmho opened this issue Nov 14, 2024 · 0 comments
Open

React Native - Parsing Server Error Response gives "missing trailer" #2135

anmho opened this issue Nov 14, 2024 · 0 comments

Comments

@anmho
Copy link

anmho commented Nov 14, 2024

Hi all, I am currently working off of a repo inspired by the react-native example in this repo. Right now, I'm struggling to get errors to be parsed correctly using the React-Native client and a Go server.

When an error is returned from the server, the React Native client custom transport throws a missing trailers issue. curl, grpcurl, and Postman each handle and parse the error correctly.

Fields of the error thrown:

Cause: missing trailer
Code: 2
Details: 
FindDetails: function findDetails(a0) { [bytecode] }
Message: [unknown] missing trailer
Metadata: [object Object]
Name: ConnectError
RawMessage: missing trailer

This seems to be an issue with the provided custom transport implementation since thats where the error is thrown.

My custom-transport.ts is exactly as shown in the React Native example.

Reproduce:

  1. Follow setup steps in: https://connectrpc.com/docs/web/supported-browsers-and-frameworks/#react-native and https://github.com/connectrpc/examples-es/blob/main/react-native/README.md
  2. Call any RPC that returns an error to the caller.
  3. Client will throw an error with the message "missing trailer"

Example repo:
Clone this repository
Run make gen
Run npm run ios in /react-native
Run Dev Server using make watch in the project root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant