Requested module experienced an error while loadingin Roblox Luau: what it means and how to fix it
What it means
The script called require on a ModuleScript, and the module itself stopped with an error while it was running. The real error is the red line printed just above this one in the Output window.
The smallest script that triggers it
-- ModuleScript "Config"
local Config = {}
Config.Speed = baseSpeed + 4
return Config
-- Script
local Config = require(script.Parent.Config)
The fix
-- ModuleScript "Config"
local Config = {}
local baseSpeed = 16
Config.Speed = baseSpeed + 4
return Config
-- Script
local Config = require(script.Parent.Config)
baseSpeed was nil inside the module, so the module failed before it could return. Once the module runs cleanly, require succeeds.
Common causes
- A runtime error on any line of the ModuleScript that runs when it loads.
- A syntax error in the ModuleScript.
- Two modules that require each other, so neither can finish loading.
Practice this until it sticks
A Deep Dive on ModuleScripts and require: 5-minute lessons, each with a quiz. What you miss comes back in the next module. One Deep Dive a day is free. No card.