Just like people, when the AI doesn't have enough information, it fixes things by guessing. And guesswork fixes break other things.
Copy the entire red error message from the terminal or from your browser's F12 → Console. Adding a screenshot makes it even better.