How do I prevent this from happening?
It's specifically pointing out line 1 is causing the error
game:GetService("ScriptContext").Error:Connect(function(message, trace, theScript) if theScript then print(theScript:GetFullName()) end end)
The short answer is that you're erroring in a callback function that's called for every error.
Link150 has an extended explanation that details recursive functions.