Skip to content

Additional Considerations

Let’s say that we have two modules, Foo and Bar. Luau will try to resolve the paths if it can find any require in any scripts. In this case, when you say ./bar, Luau will resolve it as: relative to this script, go to my sibling script named Bar.

There are some caveats here though. For instance, the require path must be resolvable statically, otherwise Luau cannot accurately type check it.

Cyclic module dependencies can cause problems for the type checker. In order to break a module dependency cycle a typecast of the module to any may be used: