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

gRPC errors in nice-grpc-web come back as undefined in angular 18 in optimized builds with zonejs #606

Open
davidfiala opened this issue Jun 4, 2024 · 0 comments

Comments

@davidfiala
Copy link
Contributor

I'm not sure when this may have crept in, but I'm noticing that gRPC errors sent back from Envoy are being thrown as from the gRPC stub as undefined instead of ClientError when they come back from a nice-grpc-web method stub. gRPC errors come back correctly for the exact same gRPC request and response (as viewed in network inspector panel) if you aren't in angular prod build, with optimizations, or with zonejs all at once.

This occurs with:

Angular 18 with @angular-devkit/build-angular:application.
prod build mode (optimizations = true)
zonejs
If I switch off zonejs or optimizations, then nice-grpc-web stubs return gRPC errors like normal.

I got a hint to try turning off zonejs because I found that the stack trace was so incredibly obfuscated in my browser, even when I enabled sourcemaps. Fortunately angular 18 is the first version that (mostly) supports zoneless. Once I turned it off, I noticed that gRPC ClientErros are being thrown properly again.

I suspect that there's a chance this is more of a zonejs issue than a nice-grpc issue, but in either case even if this gets closed, I wanted to drop my experience here in case anyone else is searching for a similar issue.

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