-
Notifications
You must be signed in to change notification settings - Fork 764
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
Status Codes are shown in incorrect alphabetical ordering #1243
Comments
Aha interesting.. thanks for pointing this out! I'm curious if it causes any build time / runtime issues? Or any other usability issues? Thanks! |
Yes it is causing a lot of issues, I did not notice this until now, but I have a check for |
@chandraaditya thanks so much for your fix!
Also thanks for the comment! Although I'm wonder if this will actually cause a runtime issue or not? As far as i understand, if you have a check in .ts file that looks like grpc-web/net/grpc/gateway/examples/echo/ts-example/client.ts Lines 84 to 88 in 903601a
Then when tsc compiles the TS file, the same code will be generated as Javascript, and it would work. Is that right? (Or maybe an advanced tsc mode will directly output the enum number rather than If so, then I guess this issue will be causing some confusion during understanding the error (when referring to the index.d.ts file), but not causing a runtime issue? Thanks in advance :) |
Not a problem! So I'm using NextJS and I'm not entirely sure how it compiles TS and if it does some weird stuff. But essentially what was happening was I needed to check if the response was Because even though my server is sending the But apart from the fact that my code was not working, I'm not 100% sure what the reason was, I do remember trying to |
Oh wow thanks for the very detailed explanation! It's very interesting to know! 😃 I'm not familiar with NextJS so maybe it's somehow directly compile the TS enum into numbers (unlike the TS example we have, which pretty much generated the same JS code and was working fine for us.) We'll definitely keep this difference in mind going forward, and will be careful about future enums! Thanks a lot for your report and code fix! 😃 |
I don't know why, but the StatusCode enums are in the wrong order.
grpc-web/packages/grpc-web/index.d.ts
Line 130 in 1779661
That shows them sorted alphabetically, but they are not actually that way at all. The actual ordering:
The text was updated successfully, but these errors were encountered: