You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use ProtoBuf.js to work with this proto file:
var ProtoBuf = require("protobufjs");
var builder = ProtoBuf.protoFromFile("gtfs-realtime.proto");
This causes an error:
...ProtoBuf.js:572
throw(new Error("Illegal top level declaration: "+toke
^
Error: Illegal top level declaration: syntax
at ProtoBuf.DotProto.Parser.Parser.parse (..ProtoBuf.js:572:31)
at Object.ProtoBuf.protoFromString (..ProtoBuf.js:2592:33)
at Object.ProtoBuf.protoFromFile (..ProtoBuf.js:2634:53)
at Object. (..test.js:6:24)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
The text was updated successfully, but these errors were encountered:
There seem to be two statements that are not understood by ProtoBuf.js yet: syntax = "proto2"; and extensions 1000 to 1999;. You can try to remove or comment-out those until I get some time to fix the parser to just ignore it.
Thanks, seems to work so far.
Thanks for the nice library. I just started to work with your stuff. Except for the reported issue, your library works fine for me.
Google defined the so-called GTFS-realtime interface in 2011.
https://developers.google.com/transit/gtfs-realtime/
The interface is implemented using protocol buffers. The proto file can be found here:
https://developers.google.com/transit/gtfs-realtime/gtfs-realtime-proto
I try to use ProtoBuf.js to work with this proto file:
var ProtoBuf = require("protobufjs");
var builder = ProtoBuf.protoFromFile("gtfs-realtime.proto");
This causes an error:
...ProtoBuf.js:572
throw(new Error("Illegal top level declaration: "+toke
^
Error: Illegal top level declaration: syntax
at ProtoBuf.DotProto.Parser.Parser.parse (..ProtoBuf.js:572:31)
at Object.ProtoBuf.protoFromString (..ProtoBuf.js:2592:33)
at Object.ProtoBuf.protoFromFile (..ProtoBuf.js:2634:53)
at Object. (..test.js:6:24)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
The text was updated successfully, but these errors were encountered: