Changing game.Service name results in game:GetService failing type inference on modules

Wow what a long name for a title, anyhow I recently learned that changing the name of a service (whether through explorer or through console) can often cause issues on how the script editor handles modules.

For an example, I changed the name of ReplicatedStorage to ReplicatedContainer and insert a module in the service to be used by a script. Within the module it will define module.message = "hello world".
image

image

Now within the script in ServerScriptService, I will require this module to print out module.message. However, typecheck will instead consider it to be an unknown require. Of course, this now means that you will get zero autofill options or anything to assist with modules. I assume that this is not intended feature, and the only workaround would be setting the service’s back to their original name, but nonetheless I don’t believe that this should continue as-is.

1 Like

For some odd reason, it didn’t include the other screenshots, here they are:

image

I can’t repro this not working (and can be pretty sure it’s generally working because we rely on the same autocomplete for developing code internally).

What beta features / plugins do you have?

1 Like

The devices that I have tested this on have no beta features enabled. Nor is there any plugin modification. Perhaps there IS some sort of beta feature that could fix this? I should probably test the new Luau type solver and see if I can still replicate it there.

Something to note is that this issue only occurs when using game:GetService, getting the module in any other way doesn’t cause this issue. In my example, I can use game.ReplicatedContainer.Module and it works just fine.