-
Notifications
You must be signed in to change notification settings - Fork 349
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
fix: Extend global.Error
to avoid import collisions with Error proto msgs
#699
fix: Extend global.Error
to avoid import collisions with Error proto msgs
#699
Conversation
…sages We have an `Error` proto that causes typescript issues when imported into the proto file of a service definition, as the `export class GrpcWebError extends Error` added to the output .ts files for the service think we're trying to extend our type, not the js type. Change here is to simply use `global.Error` to avoid the issue
global.Error
to avoid import collisions with Error proto msgsglobal.Error
to avoid import collisions with Error proto msgs
Ah yeah, @MorganIsBatman this is great! We've definitely that this issue in the past, with Can you run That will get the build passing + be a regression against the prefix accidentally going away in the future. |
Oh! sorry @stephenh - I missed that step in my haste. I've run through building the tests and running them via both the standard and :local variants on my intel Mac and M1 but both have a few tests fail for reasons I'm not totally understanding. They seem to fail when run on the master branch too? I've committed the results of running |
This based on feedback from someone in my team using Vite and importing the .ts file rather than the compiled .js file - using `global` errors as its declared in the same file
Ah yeah, @MorganIsBatman didn't have a chance to look in to this now, but sorry, the issue was an admittedly non-obvious foot gun that the The non-/pre-docker setup lead to build output flakiness b/c each contributors version of I went ahead and pushed the I'm also going to make a follow up PR that removes the Thanks! |
## [1.131.1](v1.131.0...v1.131.1) (2022-11-13) ### Bug Fixes * Extend `global.Error` to avoid import collisions with Error proto msgs ([#699](#699)) ([e9d8f91](e9d8f91))
🎉 This PR is included in version 1.131.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
You're awesome! Thanks for the quick turnaround and for taking care of that last step for me @stephenh |
We have an
Error
proto (I assume reasonably common) that causes typescript issues when imported into the proto file of a service definition, as theexport class GrpcWebError extends Error
added to the output .ts files for the service now references the imported Error type, not javascript's Error class.Change here is to simply use
global.Error
to avoid the issue