What Is Luau Modularity? Export, Frozen Tables and Cyclic Requires
Luau Modularity is a Studio beta: modules export values, functions and types directly with export, and two modules can require each other. How it works.
In this guide
The Old Way: Build a Table and Return It How to Enable Luau Modularity and Export Directly Exported Tables Freeze After Loading Cyclic Requires Finally Work — With One Rule Five Errors to Know When a Cycle Goes Wrong What Not to Do Yet Frequently Asked Questions What is Luau Modularity? How do I turn on Luau Modularity? Do my existing modules still work? What does it mean that exported tables freeze? Can two modules require each other now? Why does Luau need cyclic requires? Can a module support cycles without using export? Related Guides on RBXMods SourcesEvery Roblox game of any size is built from ModuleScripts — small files of shared code that other scripts load with require(). Until now, every module ended the same way: build a table, put your functions in it, and return it. Luau Modularity, a Studio beta announced on November 12, 2026, in a dedicated thread on the Developer Forum — and included in the Weekly Recap for November 9–13 — changes that. Modules can now export values, functions and types directly with the export keyword, and — the bigger change — two modules can finally require each other. This guide explains what Luau Modularity does, how the new syntax works, what freezes, and the one rule that still applies to modules that depend on each other.
Key takeaways
- Luau Modularity is a Studio beta, announced November 12, 2026, on the Developer Forum: enable it under File → Beta Features before trying it.
- Modules can now export values, functions and types directly with
export, instead of building a table and returning it at the end. - Exported module tables freeze after loading, so nothing can add to or change them later.
- Cyclic requires work now, but only when every module in the cycle uses
export— and a module in a cycle can only touch the other module inside function bodies, not at the top level. - It is a beta: test it in Studio rather than rebuild a live game's core systems on it yet, and your existing modules keep working exactly as they are.
The Old Way: Build a Table and Return It
A ModuleScript runs nothing on its own. When another script calls require() on it, Luau runs the module once, caches what it returns, and hands that same value to every later caller. For years, the value has almost always been a table built by hand:
-- Rewards (a ModuleScript, in ReplicatedStorage)
local Rewards = {}
Rewards.DAILY_COINS = 50
function Rewards.grant(player, amount)
player:SetAttribute("Coins", (player:GetAttribute("Coins") or 0) + amount)
end
return Rewards
That pattern works, and it is not going anywhere — every module you have already written keeps working as it is. The cost is boilerplate: a local table at the top, every function attached to it, and a return at the bottom that is easy to forget — in a big game, that ceremony adds up and hides what the module actually offers. If you are new to modules, our first Lua script guide covers the three script types and where each one runs.
How to Enable Luau Modularity and Export Directly
With Luau Modularity enabled, a module can export what it offers directly, without building the table itself. The Weekly Recap describes it plainly: the beta "adds exported values, functions, and types so modules can export directly". The same Rewards module, rewritten with the new syntax, shows the difference — the full version, not a sketch:
-- Rewards (a ModuleScript, with Luau Modularity enabled)
export const DAILY_COINS = 50
export function grant(player, amount)
player:SetAttribute("Coins", (player:GetAttribute("Coins") or 0) + amount)
end
Functions and types follow the same idea: mark them with export and they become part of the module's public surface, no return table needed. The module still runs once per environment and the result is still cached. What changes is only how the module declares what it shares — visible at a glance instead of buried in a table built line by line. Enable the beta in Studio under File → Beta Features before trying it — export is part of the beta, not of standard Luau.
Four rules govern the new syntax, all stated in the announcement: exports must be at the top level of a module — you cannot export values from nested blocks; you cannot combine export with a top-level return, so a module that exports anything must not return a table (a likely migration trap); exported names must be unique within a module; and exported functions and export const variables cannot be reassigned.

Exported Tables Freeze After Loading
There is one behaviour to know before you start exporting: exported module tables automatically freeze after loading. The table cannot be changed afterwards — no adding fields, no replacing functions, no patching values from another script. If your code today reaches into a module's table after requiring it and tweaks something, that pattern stops working.
In practice this is a guardrail, not a trap: no other script can quietly rewrite the module you required, and a bug in one system cannot corrupt a shared module for everyone else. But the freeze applies inside the module too, and this is the part that catches people out: an exported value cannot be reassigned after loading, even by the module itself. The announcement's own example is an exported counter with an exported increment() function — calling increment() after the module finishes loading raises an error. So do not keep mutable state in an exported value: keep it in a private local instead — a non-exported local counter = 0 mutated by an exported increment() works, because the counter itself is not exported — and expose it through exported functions. Our DataStore guide shows the same idea in a different shape: one module owns the data, and everything else goes through its functions.
Cyclic Requires Finally Work — With One Rule
The change most experienced scripters will notice is cyclic requires. Until now, two modules that required each other were a dead end: Luau detected the cycle while loading and raised an error, so the standard advice was to restructure the code so dependencies only flowed one way. Roblox's announcement frames the new feature as easier organization around shared dependencies — a more explicit alternative to combining modules into one large file or using lazy requires inside functions. The design document gives a second reason the old advice got painful: it describes classes — which must be defined entirely in one module — as a feature Luau is adding, so two classes that refer to each other could not be written as separate modules at all. The beta announcement itself does not mention classes.
With the beta, cyclic requires work, but only when every module in the cycle uses export. That condition is what lets Luau tie the knot: when it meets a cycle, require() hands back the module's export table before it is finished, and the table is filled in as loading completes. And there is one rule that still applies: a module in a cycle can freely access the other module's exported symbols inside function bodies, but not at the top level — the values cannot be guaranteed to exist yet while the modules are still loading, so top-level access raises a clear error instead of silently handing back half a module.
The practical way to think about it: a cycle is fine for things that happen later — functions that run when a player clicks, when a round starts, when an event fires. It is not fine for things that happen immediately — reading a value at the top of the file, or building a class that extends the other module's class at load time. If your cycle needs top-level access, restructure so the dependency flows one way, or move the access into a function. Our RemoteEvents guide covers the other half of the story: how scripts on different sides of the game talk to each other without sharing modules at all.
There is also a right and a wrong way to read a module you depend on. Safe access means keeping the module reference and reading its exports after the module finishes loading; unsafe access means pulling a field out at require time, or reading it while the module is still loading. Keep the table require() returns and read its fields when you need them — that way a value that has not been assigned yet cannot break your code.

Five Errors to Know When a Cycle Goes Wrong
When a cycle breaks, Luau raises one of five errors — cause and fix for each, from the announcement:
| Error | What went wrong | Fix |
|---|---|---|
| You cannot call require on a module that is loading. | A module still loading after the cycle breaks. | Should not happen in normal code — submit a bug report. |
| This require was not allowed because the value is not a table. | Accessing a value from a module that returns a value, not a table. | Restructure the code to avoid the cycle. |
| You cannot use export values inside a cyclic require. | A module reads an export from a module still loading in a cycle. | Move the read inside a function. |
| You cannot use export values from a module that has a value return type. | A module reads an export from a module that returns a value directly. | Restructure the code to avoid the cycle. |
| This export cannot be used here because the module was reloaded. | The module was reloaded after you got its export table. | Keep the export table; do not access it after a reload. |
What Not to Do Yet
Do not rebuild a live game on it today. Luau Modularity is a Studio beta, for testing in Studio — do not make a live game's core systems depend on it until Roblox moves it out of beta. Try it in a test place, in a new module, or in a copy of your game.
Do not convert everything at once. Old modules keep working exactly as written, and a mixed codebase is fine. Convert a module when you are already editing it, not in one sweeping pass.
Do not put a non-table return value in a cycle. Modules that return something other than a table — a number, a function, a single value — keep working as before, but cannot participate in cycles. Only table-shaped exports join a cycle.
Watch out for very large cycles. The design document notes that modules in a cycle are typechecked together, which can make typechecking slow, and it proposes a warning when a cycle cluster gets too large — that warning is a plan in the design document, not shipped behaviour. Keep cycles small and deliberate: the feature exists so two modules that genuinely need each other can stay separate, not so your whole game can become one big cycle.
Check the Output window when a cycle fails. A cyclic dependency error is a load-time error, so it shows up in Studio's Output window when the module loads — our script errors guide covers tracing it back to the line that caused it.
Frequently Asked Questions
What is Luau Modularity?
Luau Modularity is a Studio beta that lets ModuleScripts export values, functions and types directly with the export keyword, instead of building a return table — and it lets modules require each other, which Luau previously refused to do.
How do I turn on Luau Modularity?
In Roblox Studio, go to File, then Beta Features, and enable Luau Modularity. It is a beta, so it is for testing in Studio, not for a live game's core systems yet.
Do my existing modules still work?
Yes. Modules that build a table and return it keep working exactly as they are, and they can live alongside modules that use export. You do not need to convert anything.
What does it mean that exported tables freeze?
After an exported module loads, its table cannot be changed — no other script can add fields or replace functions on it. Keep mutable state inside the module and change it through exported functions.
Can two modules require each other now?
Yes, but only when every module in the cycle uses export, and only for access inside function bodies. Reading the other module's exports at the top level of a file in a cycle raises a clear error.
Why does Luau need cyclic requires?
Roblox's announcement frames it as easier organization around shared dependencies — a more explicit alternative to combining modules into one large file or using lazy requires inside functions. The design document adds a second reason: classes must be defined entirely in one module, so two classes that refer to each other could not be written as separate modules without cycle support.
Can a module support cycles without using export?
No — under the shipped beta, every module in a cycle must use export. The original design document describes a compatibility pattern (local exports = ... or {}) for code that must run in older Luau environments, but that pattern on its own does not make a module cycle-capable in the Studio beta; the amended design the beta follows requires export for cyclic imports.
Related Guides on RBXMods
- Your first Lua script in Roblox Studio — the three script types, where each one runs, and your first working script.
- RemoteEvents and RemoteFunctions explained — how scripts on different sides of the game communicate without sharing modules.
- DataStores explained — one module owning player data, and everything else going through its functions.
- How to read Roblox Studio script errors — tracing a load-time error in the Output window back to the line that caused it.
RBXMods is not affiliated with or endorsed by Roblox Corporation. Roblox and the Roblox logo are trademarks of Roblox Corporation.
Sources
Sources last reviewed December 1, 2026; each page was verified loading on the date noted beside it.
- Roblox Developer Forum: [Studio Beta] Luau Modularity: export Values and Cyclic Requires — the November 12, 2026 announcement: the export rules, frozen tables, cyclic requires, safe and unsafe access, and the five errors. (Verified loading in the live browser 2026-12-01.)
- Roblox Developer Forum: Weekly Recap: November 9 – 13, 2026 — the recap (published November 13, 2026) summarizes the beta: exported values, functions and types so modules can export directly, and cyclic requires when every module in the cycle uses export. (Verified loading in the live browser 2026-12-01.)
- Luau RFCs: Export Keyword — export is allowed only before top-level variable and function declarations; a module with export cannot also have a top-level return; exported names must be unique; export const and exported functions cannot be reassigned; the exported counter example. (Verified loading 2026-12-01.)
- Luau RFCs: Support Cyclic Imports (amended) — the amended design the beta follows: require() automatically supports cyclic imports for modules that use the export keyword. (Verified loading in the live browser 2026-12-01.)
- Roblox Creator Docs: Reuse code (ModuleScripts) — ModuleScripts let you reuse code between scripts on different sides of the client-server boundary; how a module is written and required. (Verified loading in the live browser 2026-12-01.)
- Roblox Creator Docs: ModuleScript (Engine API Reference) — a script type that runs once when require() is called with it, returning exactly one value, usually a table of functions. (Verified loading in the live browser 2026-12-01.)