模块引用异常,模块对象由table变为userdata导致无法使用

426 views
Skip to first unread message

xiang peng

unread,
Sep 4, 2019, 9:22:18 PM9/4/19
to openresty
模块引用异常,模块对象由table变为userdata导致无法使用,求解
common是我指定的lua包引用地址,是项目里的一个层级,commlib.lua在common的根目录,google.lua是common目录下其他文件夹中的文件,在google.lua中引用commlib.lua时,发生了commlib的对象本应该是table类型的,结果变为suerdata类型,导致无法使用
2019/09/05 01:15:14 [error] 6#0: *2 lua entry thread aborted: runtime error: ./common/libs/google.lua:128: attempt to index upvalue 'commlib' (a userdata value)
stack traceback:
coroutine 0:
        ./common/libs/google.lua: in function 'get_detail_info_by_token'
        ./common/commlib.lua:37: in function 'get_detail_info_by_token'
        /opt/openresty/subscriptions/v1/sub.lua:56: in function </opt/openresty/subscriptions/v1/sub.lua:1>, client: 172.17.0.1, server: , request: "POST /v1/sub HTTP/1.1", host: "127.0.0.1:13001"

xiang peng

unread,
Sep 5, 2019, 5:51:36 AM9/5/19
to openresty
已修复,包的循环引用导致

在 2019年9月5日星期四 UTC+8上午9:22:18,xiang peng写道:
Reply all
Reply to author
Forward
0 new messages