Requiring a Module requires a "MainModule"

Here is the error I am currently receiving:

Unable to find module for asset id 78628683807311. Does the asset have a ModuleScript named "MainModule"?

This asset previously worked without having a “MainModule” inside it. For context, here is the exact command I ran in the console to trigger it:

require(78628683807311)

The problem:

Naming every script “MainModule” makes local organization incredibly difficult. Allowing the engine to grab the top-level module regardless of its name would let developers to keep descriptive names on their scripts. This would make searching through assets significantly easier and eliminate the need to open scripts to differentiate between them.

Expected behavior

I expect Roblox to automatically recognize the primary or top-level ModuleScript as the “MainModule”, rather than strictly requiring the exact name “MainModule” at the root level.

1 Like