Comments (5)
Yeah, we're probably just missing the prefix; can you paste ~5-10 lines of code that show the throw new Error
that's missing the globalThis
?
from ts-proto.
Sure thing! Here's a sample of what gets generated for google/protobuf/wrappers
:
export const Int64Value = {
encode(message: Int64Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.value !== BigInt("0")) {
if (BigInt.asIntN(64, message.value) !== message.value) {
throw new Error("value provided for field message.value of type int64 too large");
}
writer.uint32(8).int64(message.value.toString());
}
return writer;
},
And here is a sample of the Error
proto def:
syntax = "proto3";
package myapp.common.v1;
import "google/protobuf/struct.proto";
message Error {
string code = 1;
string message = 2;
google.protobuf.Struct extra = 3;
}
This simple diff:
if (BigInt.asUintN(64, message.positiveIntValue) !== message.positiveIntValue) {
- throw new Error("value provided for field message.positiveIntValue of type uint64 too large");
+ throw new globalThis.Error("value provided for field message.positiveIntValue of type uint64 too large");
}
Is enough to get rid of tsc
errors on these lines.
from ts-proto.
🎉 This issue has been resolved in version 1.166.4 🎉
The release is available on:
Your semantic-release bot 📦🚀
from ts-proto.
Thank you so much for the quick fix @stephenh! 🙏 I'll give this a try on Monday and report back if there are any issues.
from ts-proto.
Works great, thank you again @stephenh 🎉
from ts-proto.
Related Issues (20)
- Add common types to their own file/export w/outputIndex option HOT 2
- Questions about defaults, optionals, arrays, null/undefined HOT 2
- Support `google.api` attributes/conventions HOT 1
- NestJS without Observables HOT 1
- meta generated for messages with oneOf properties is incorret for other properties HOT 1
- Add types for toJSON/fromJSON methods HOT 1
- TypeError on Runtime ChannelCredentials object HOT 1
- Using 'useDate=string' parameter; the response is still anticipating an object for Timestamp Wrapper
- Encode crashes on `null` object values HOT 2
- Rpc doesn't account for metadata HOT 2
- Rpc is not exported by ts-proto as it previously was HOT 6
- Generated affixes HOT 1
- Conflicting protobuf definitions when using ts-proto plugin with Buf HOT 2
- Support for proto-loader "virtual" oneof field
- Release updated ts-proto-descriptors? HOT 4
- Proto import statements not being recognized HOT 1
- Support for messages with the same name as an rpc method HOT 2
- unexpected changes in `camelToSnake()` at v1.176.1 HOT 7
- Typescript as peerDependency HOT 3
- Easier to use oneof=union generated code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-proto.