Not sure if it is a Vue or Vite issue, but when I change HTML in template tag in a Vue + Vite project, I’m getting an error:
ReferenceError: can't access lexical declaration 'ComponentName' before initialization
and
[hmr] Failed to reload /src/views/ComponentName.vue. This could be due to syntax errors or importing non-existent modules. (see errors above)
This is true only for some components/views and only regards template, the script and style tags don’t cause the erorr to happen. I cannot find any regularity in this, like it only affects a random number of components.
What can be causing this?