ROBLOX fails to properly cache certain ModuleScript returns, causing re-execution

Although my entire project is currently running on a single thread (per environment, client & server), runtime ModuleScript(s) aren’t properly cached, resulting in them being executed twice (only twice, never more).

I sadly could not replicate this issue in an empty place, as such there has been instructions and a place file provided the staff attached message

Expected behavior

When requiring a ModuleScript, the expected result is for that module to only load it’s contents once, and then cache the response.

A private message is associated with this bug report

I’m interested in this, would you be able to provide a repro file here?

Those are prints from two different clones of the same ModuleScript.

Because output is coming from clones, Studio does unfortunately report the same origin name, but if you check script:GetFullName() you will see that one is inside the Player and the other is running directly in StarterPlayerScripts.

Ah! I completely overlooked that on my end. Relative string path(s) from Darklua had resulted in grabbing the wrong script.

Is there a reason that the debugging tracebacks don’t show outside the scope of the ModuleScript? I know this isn’t necessarily a bug, rather just something that’s intended (lack of a feature thereof)

Studio tries to track clones based on internal unique script identifier and uses that one to map to a name in the error message.

I will ask the team for a reason why full name is not used here as it made this issue harder to diagnose.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.