Missing variable causes script editor to break

Create a new LocalScript (doesn’t really matter what type of script) and paste the following code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local TextureFolders = nil
local ElapsedTime = 0

local UpdateTime = 0.05

RunService.Heartbeat:Connect(function(DeltaTime:number)
	ElapsedTime += DeltaTime

	if ElapsedTime >= UpdateTime then
		ElapsedTime -= UpdateTime

		TextureIndex += 1
		if TextureIndex > 17 then TextureIndex = 1 end
		script.Parent.TextureID = TextureFolder[tostring(TextureIndex)].Texture
	end
end)

The script has an unassigned TextureFolders variable, with a TextureFolder “misspelled” version written below.
If done correctly, an orange bar should appear at the top without stating its existence reason:


Opening up the Script Analysis window shows a warning stating “Luau::follow detected a Type cycle!!”:
image
This causes the editor to break for all scripts, causing autocomplete and syntax compiling to not work:

Restarting Studio fixes the issue. Opening the bugged script causes the bug to occur again. To note I have the New Luau type solver enabled. Disabling it also fixes the bug in all cases.

Expected behavior

I’m expecting the script to underline the TextureFolder as being UnknownGlobal, not break the whole editor.

1 Like

pretty sure this is the new type solver and its antics

a similar issue even happens with comments at the top of scripts for whatever reason

Sure is, but still an annoying bug since it breaks for all other scripts.
Interestingly, deleting the bugged script’s content and re-opening it again still shows the orange bar, despite no code.

2 Likes