-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Well known proto3 types missing from npm package #1638
Comments
The well-known types are in the npm package now. |
When I use NPM package to get well know know types, it gives the file with import style as commonjs. How do I get well know types for import style closure? |
@thefunnyguy I think for now you just have to build the well-known types manually with protoc if you want to use Closure-style imports. We could potentially consider including both import styles in the NPM package, though. What does your build setup look like? |
Some of my proto files are using "import "google/protobuf/timestamp.proto";" I am using bazel build system so all code is closure style. Initially I tried using "closure_js_proto_library" rule to covert my protos to closure style. But well known types are not available, so its failing. I ended up running the below command to generate JS file: But still goog.require for well known type fails as those closure style files are not available. I thought to get those file using NPM, but the files are in commonjs style, so google require statements are still failing. I ended up taking the whole google protobuf folder and compiled the proto files using protoc, something like: This seems to resolve the errors for now, but not sure if that's the correct way. Having closure style NPM package will make life easy i guess. |
Hi All
I'm using proto3 with the last beta 3 (v3.0.0-beta-3) to generate javascript DTOS as CommonJs modules.
In the generated javascript, built in proto type (e.g.
google.protobuf.Timestamp
) are 'required' but don't exist.For example, given this proto:
And this command:
we get this output:
The file
timestamp_pb.js
isn't generated (notetimestamp.proto
does exist under my protoc executable) thus doesn't exist at the generated path.I'd expect it to exist in the
google-protobuf
npm package, e.g. the generated code should berequire('google-protobuf/somePathHere/timestamp_pb.js')
.First reported on google groups, it was suggested I create this issue.
The text was updated successfully, but these errors were encountered: