0

In a tRPC router procedure, I have an error condition that will throw a TRPCError with code "BAD_REQUEST" and a custom message. When running this application with npm run dev, it works as expected and the error is returned to the React component with the message that it can consume and display. After building the application and hosting it in IIS using IISNode, any errors in procedures are returned as plaintext "Bad Request". Interestingly, hitting the IIS-hosted version from Postman on the server itself gives a proper JSON response. When the same endpoint is hit from Postman outside the server, it's the plaintext "Bad Request".

Is this a problem with environment setup or something else?

A. Rahm
  • 39
  • 4
  • The 400 bad request error is an HTTP status code that describes an error caused by an invalid request. Therefore, the server cannot understand and process it. Most HTTP errors 400 Bad Request are caused by malformed request syntax, invalid request message framing, or deceptive request routing. – YurongDai Feb 16 '23 at 03:18

0 Answers0