Type check warns when requiring a module after getting its name

I have been getting warnings regarding type checking for most of my scripts, one of them being with this type of code

for _, data: ModuleScript in module.Keyframes:GetChildren() do
	object.keyframes[tonumber(data.Name)] = require(data)
end

As you can see I am getting the module’s name and also requiring said module. However, require(data) is underlined with a warning for whatever reason.


Asked AI about it but I didn’t get any proper answers. These warnings are new to me and I am not someone who follows many type checking rules as I can read my own code.

If there is a way to fix this or maybe even disable warnings like this then I am all ears.

sketchy method: data :: Instance

the :: typecasts a value to be the specified type, really useful in keeping roblox’s typechecker silent for things like this

the reason I say it’s sketchy is because require should be accepting ModuleScript by default and this feels like a hack to me