Page 1 of 1

[2.1.9] requiring a relative lua path does not cache the file

Posted: Wed Jul 08, 2026 9:06 pm
by Quezler
In 2.1 a required lua file only runs once, which means these all return the same instance:

require("thing")
require("__modname__.thing")
require("__modname__/thing")

However, relative paths are each seen as unique:

require("__modname__/./thing")
require("__modname__/././thing")
require("__modname__/./././thing")

The expected behavior is that the path gets resolved to an absolute path first. (which also gets used when logging from within that file, vs it also being relative)

Re: [2.1.9] requiring a relative lua path does not cache the file

Posted: Thu Jul 09, 2026 1:11 pm
by Rseding91
Thanks for the report. As a simplification these types of paths will simply be disallowed for the next release. As far as I know there is no legitimate reason to ever use them.