Cannot insert html comment, and undo throws error


I have an html page. I wanted to put a comment on an empty line between a couple of divs.

For some reason, the command-/ shortcut instead comments out the rest of the document. Then, when I undo it, the console pops up with this error:


It’s actually worse than I thought. See the attached animated GIF. I have the cursor on line 37, to add a new comment before the body tag. I use command-/ and instead of adding the comment, part of a PREVIOUS comment is un-commented.

UPDATE: this might be related to Emmet package. I uninstalled it, and now commenting behaves as expected.