Comments (5)
Hi! Thanks for raising an issue. Could you show me the .proto
file you used and the protoc
command used? This doesn't look like it should be happening.
from protobuf.
Hi @johanbrandhorst , this would generate an instance of import google_protobuf "google/protobuf"
syntax = "proto3";
package account;
import "google/protobuf/any.proto";
message Account {
google.protobuf.Any metadata = 1;
}
from protobuf.
Yeah so I suspect you're not using the correct type replacing 😬. If you take a look at the example repo you can see that you'll need to use the -M
parameter to get the correct imports in the resulting file when using a Google Protobuf Well Known Type (such as any.proto or timestamp.proto):
https://github.com/johanbrandhorst/grpcweb-example/blob/master/Makefile#L4
protoc -I. -Ivendor/ proto/library/book_service.proto \
--gopherjs_out=plugins=grpc,Mgoogle/protobuf/timestamp.proto=github.com/johanbrandhorst/protobuf/ptypes/timestamp:$$GOPATH/src \
--go_out=plugins=grpc:$$GOPATH/src
If you try using --gopherjs_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/johanbrandhorst/protobuf/ptypes/any
, it should work :). Let me know how it goes!
from protobuf.
ah it works now thanks! Is there anyway to automate it?
from protobuf.
Unfortunately this M
-parameter always has to be supplied to protoc
since the source file you're using declares option go_package = github.com/golang/protobuf/ptypes/any
. Glad it fixed your use case though!
from protobuf.
Related Issues (20)
- Idea: Hack in support for bidirectional streaming with websockets HOT 8
- Change option go_package to gopherjs_package to avoid conflicting packages
- Break out WsProxy into general purpose websocket <-> gRPC backend proxy HOT 1
- Figure out whats wrong with Firefox integration tests
- Integration Test: Switch from ChromeDriver + Chrome to ChromeDriver + Chrome Headless
- Wsproxy: switch payload size encoding/decoding burden to websocket client
- Wsproxy: context cancellation does not propagate across websocket transport HOT 1
- Wsproxy: add support for existing CallOptions HOT 2
- Cancel requests on context cancellation
- protoc-gen-gopherjs: Consider migrating to https://github.com/lyft/protoc-gen-star HOT 1
- adapting the concept to interface with Flutter HOT 5
- Try using decode.io protobufjs instead of Google-protobuf HOT 1
- Large integers are not correctly parsed
- Suggestion: Allow enabeling WebSocket transport, even if rpc isn't BiDi or server stream HOT 4
- Interop test for Envoy, nginx and grpcwebproxy backends HOT 2
- Add js tags to protobuf-generated types HOT 2
- Does not work with Node.js HOT 5
- Might be worth updating this now that caddy 2 is stable and tinygo can compile to WASM HOT 2
- Unable to run simple gopherjs demo with protoc compiled grpc-web 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 protobuf.