protoc-gen-lua icon indicating copy to clipboard operation
protoc-gen-lua copied to clipboard

Failed to parse message in lua when proto file imports another proto file

Open qiyuguo opened this issue 9 years ago • 5 comments

Failed to parse message in lua, when the message contains embedded field which is defined in another proto file.

the error message and stack:

[LUA-print] LUA ERROR: [string "pb/containers.lua"]:27: attempt to index field '_message_descriptor' (a nil value)

[LUA-print] stack traceback: [string ".\script/main.lua"]:53: in function <[string ".\script/main.lua"]:50> [string "pb/containers.lua"]:27: in function 'add' [string "pb/decoder.lua"]:249: in function 'field_decoder' [string "pb/protobuf.lua"]:684: in function '_InternalParse' [string "pb/decoder.lua"]:271: in function 'field_decoder' [string "pb/protobuf.lua"]:684: in function '_internal_parse' [string "pb/protobuf.lua"]:693: in function 'merge_from_string' [string "pb/protobuf.lua"]:702: in function 'ParseFromString'

qiyuguo avatar Mar 20 '15 03:03 qiyuguo

Is it a bug? or I missed something when compiling proto files? Any suggestion or solution will be appreciated.

qiyuguo avatar Mar 20 '15 03:03 qiyuguo

This project does have some bugs,most in encrypting messages in lua.You may post your proto file here,or we can help you to figure it out

ukid avatar May 25 '15 03:05 ukid

did this bug is fixed?

nneesshh avatar Mar 31 '16 08:03 nneesshh

I got this error message either...

[error] 16634#0: *331110815 lua entry thread aborted: runtime error: lua/protobuf/containers.lua:27: attempt to index field '_message_descriptor' (a nil value) stack traceback: coroutine 0: lua/protobuf/containers.lua: in function 'add' lua/protobuf/decoder.lua:249: in function 'field_decoder' lua/protobuf/protobuf.lua:684: in function '_internal_parse' lua/protobuf/protobuf.lua:693: in function 'merge_from_string' lua/protobuf/protobuf.lua:702: in function 'ParseFromString'

a652 avatar May 31 '19 03:05 a652

@a652 I recommend you use starwing/lua-protobuf instead.

ukid avatar May 31 '19 03:05 ukid