gvvaughan / lyaml

LibYAML binding for Lua.
gvvaughan.github.io/lyaml
Other
208 stars 34 forks source link

attempt to index global '_debug' (a nil value) #25

Closed nijikon closed 6 years ago

nijikon commented 6 years ago

When I try to load yaml in my openresty with local settings = lyaml.load(tenant.settings) it generates this error for me.

2018/03/28 20:28:06 [error] 93756#5408880: *1 lua entry thread aborted: runtime error: /usr/local/share/lua/5.1/std/normalize/_strict.lua:33: attempt to index global '_debug' (a nil value)

nginx version: openresty/1.13.6.1

nijikon commented 6 years ago

Actually it happens on local lyaml = require "lyaml"

nijikon commented 6 years ago

@gvvaughan any obvious pointers?

gvvaughan commented 6 years ago

It’s trying to load the std._debug module to determine whether or not strict variables, runtime function argument checking and others are required (I did this to avoid looking at _G._DEBUG which is a global potentially used by the caller or another library).

I think installing std._debug into your LUA_PATH will work around the issue for now, but i’ll work on having sensible defaults when it’s missing rather than causing a runtime error in the next few days.

nijikon commented 6 years ago

@gvvaughan thanks!