Requested module experienced an error while loading

I got this error in the output twice:


for this line of code:

local gameManager = require(game.ReplicatedStorage.Modules.GameManager)

and this line of code:

local displayManager = require(script.DisplaysManager)

Why is this happening? thank you.
Also, here is a picture of the Explorer:
Screen Shot 2020-04-14 at 10.21.01 AM

10 Likes

The provided error usually pops up when a ModuleScript you’re requiring throws an error. These individual errors should also appear in the output, so try resolving these and see if the loading-error disappears.

7 Likes

Hmm, I did what you said, but there is still this:
Screen Shot 2020-04-14 at 10.33.05 AM
I don’t know how to fix it…

1 Like

What @0skarian said is that the issue is occurring in the module script versus in the script requiring it.

You need to find the error in the module script so we know what the issue is. Can you provide the whole code segment for the module script-or anything that is relevant?

3 Likes

That picture I had was a picture from the ModuleScript.

Here is the code for the GameManager module:

local GameManager = {}

local Config = require(script.Parent.Configurations)
local mapsManager = require(script.MapsManager)
local timeManager = require(script.TimeManager)
local displayManager = require(script.DisplaysManager)

--vars
local intermission = false
local enoughPlayers = false
local gameRunning = false

function GameManager:Initialize()
	mapsManager:SaveMaps()
end

function GameManager:RunVotingIntermission()
	intermission = true
end

function GameManager:GameStart()
	gameRunning = true
end

return GameManager

1 Like

Do you know if the error is occurring in a different module? It appears to be DisplaysManager that is an issue.

2 Likes

I fixed that one, so now it is only the GameManager.

There doesn’t seem to be any issues here. Do you know what line the error occurs on?

1 Like

Match this picture with the code:
Screen Shot 2020-04-14 at 10.33.05 AM

local gameRunning = false

function GameManager:Initialize()
	mapsManager:SaveMaps()
end

In other words, it is on lines 11-13.

You should be able to mouse over the line and it will tell you what the issue is.

1 Like

Here:

Are you using the Beta Luau type checker by chance? I found a similar error code thrown on a post there.

EDIT: Try change Initialize to Init and see if that fixes it.

4 Likes

I don’t get it. It still says Initialize even though I set it to

function GameManager:Init()

end
1 Like

That’s a weird issue. I would try restarting studio. Also, are you using the Beta Luau type checker?

I’m using every single Beta Feature, so I don’t know.

Restarting studio didn’t help.

1 Like

Yeah, that explains why. Try disabling the Luau type checker as a beta feature and see if that works for you.

1 Like

Wait…
It works now. I have no idea what just happened, but it suddenly worked.

I didn’t even disable Luau.

16 Likes

Do you know how it is fixed? Because for mine it just become error, last time it work and now it become a error.

5 Likes

When requiring a module, I Believe using :WaitForChild() is ideal as you may be attempting to require something that hasn’t fully loaded into the game.

Well, I did that but its still has the same error.

1 Like