fix(loader): explicitely set package.loaded.modname to nil to prevent recursive loading errors

This commit is contained in:
Folke Lemaitre 2024-07-22 09:45:01 +02:00
parent 34b0126e5b
commit 12f2c74244
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 0 deletions

View File

@ -552,6 +552,8 @@ function M.loader(modname)
end
if ret then
-- explicitly set to nil to prevent loading errors
package.loaded[modname] = nil
M.auto_load(modname, ret.modpath)
local mod = package.loaded[modname]
if type(mod) == "table" then