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

Bugs which we just recently fixed in our development version and will reach you in the next release.
User avatar
Quezler
Filter Inserter
Filter Inserter
Posts: 330
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

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

Post 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)
Rseding91
Factorio Staff
Factorio Staff
Posts: 17134
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved for the next release”