[2.1.9] requiring a relative lua path does not cache the file
Posted: Wed Jul 08, 2026 9:06 pm
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)
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)