Code Mode: Gemini assistant gets stuck when creating files

For some reason it sometimes (frequently) gets stuck when creating HTML files.

The error is “Cannot set properties of null (setting ‘innerHTML’)”, which appears to be an issue within useEffect. The y.current is null at the time when it wants to set it.

Sometime asking to do it again works.

Sometime the file has to be created manually and then asking Gemini to try again.