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 know master branch is not published but I want to report this behavior, maybe is unknown. In 6.6.5 is working fine.
constprotobuf=require("protobufjs");constproto=`package main;message Foo { optional Bar bar = 2; optional string a = 1; message Bar { }}`constroot=protobuf.parse(proto).root;constFoo=root.lookupType('main.Foo');constfoo=Foo.create({bar: Foo.Bar.create({})});constbuffer=Foo.encode(foo).finish();constmsg=Foo.decode(buffer);console.log(Foo.toObject(msg));
➜ node test.js
undefined:15
d["bar"]=types[1].toObject(m["bar"],o)
^
TypeError: Cannot read property 'toObject' of null
at Type._main_Foo$toObject [as toObject] (eval at eof (/tmp/tmp.smwHGIzVCY/node_modules/@protobufjs/codegen/index.js:103:25), <anonymous>:15:20)
at Object.<anonymous> (/tmp/tmp.smwHGIzVCY/test.js:24:17)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:425:7)
at startup (bootstrap_node.js:146:9)
The text was updated successfully, but these errors were encountered:
protobuf.js version: master (tested on 8de21e1)
I know master branch is not published but I want to report this behavior, maybe is unknown. In 6.6.5 is working fine.
The text was updated successfully, but these errors were encountered: