Export
module is requiring APIService
, which is then requiring a 6,050,000characters-long module script through GetDependencies
, a script that returns metatable using the __index
metamethod to change it’s functionality to requiring a script of the indexed name descendant of Root
(in this case, the plugin’s main script). This leads to the following exceptions:
attempt to yield across metamethod/C-call boundary
ModuleScript cannot resume non-suspended awaiting coroutine
In certain conditions I don’t specifically know, the exception thrown was changed to:
cannot resume dead coroutine
which was misleading and caused me to delay the solving of the problem an hour or so.
Export
is subsequently requested by the Plugin’s main script, ScriptSynchronizer
, and that’s stated as the most recent error traceback call line. Instead, if the metamethod plainly returns the instance of the ModuleScript, even if that same ModuleScript is required afterwards outside the metamethod, no problem arises. Note that both ScriptSynchronizer
has to manually require Export
, and Export
has to manually require APIService
in order for the error to be solved; APIService
doesn’t use GetDependencies
and therefore never caused any issue.
Expected behavior
This might be expected behaviour, but it’d be nice if the errors were more descriptive or specific, if the documentation explained the timeout time of required scripts within metamethods (which I’m assuming is one heartbeat), and then even if this timeout was customizable.