On Wed, Jun 1, 2016 at 9:18 AM, Keith Woods <[email protected]> wrote:

> 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:
>
> // foo.proto
> syntax = "proto3";
>
> import "google/protobuf/timestamp.proto";
>
> message SomeMessage {
>    google.protobuf.Timestamp someTime = 1;
> }
>
>
> And this command:
>
> protoc --proto_path=./ --js_out=import_style=commonjs:./ foo.proto
>
> we get this output:
>
> /**
> * @fileoverview
> * @enhanceable
> * @public
> */
> // GENERATED CODE -- DO NOT EDIT!
>
> var jspb = require('google-protobuf');
> var goog = jspb;
> var global = Function('return this')();
>
> var google_protobuf_timestamp_pb = require(
> './google/protobuf/timestamp_pb.js'); *// NOTE
> ./google/protobuf/timestamp_pb.js doesn't exist*
> goog.exportSymbol('proto.SomeMessage', null, global);
>
> The file timestamp_pb.js isn't generated (note timestamp.proto does exist
> under my protoc executable).
>
> I'd expect it to exist in either:
>
>    1. the google-protobuf npm package
>    <https://www.npmjs.com/package/google-protobuf>, e.g.
>     require('google-protobuf/somePathHere/timestamp_pb.js')
>    2. the output generated by protoc
>
>
> I don't see anything in the repo
> <https://github.com/google/protobuf/tree/master/js> to support the first
> option, and not sure about the second.
>
We should support option (1): the google-protobuf package is supposed to
contain these well-known types. Could you create a github issue for that?


>
> Any ideas?
>
> Any help much appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to