zekedou
September 12, 2025, 3:36pm
1
I’ve run into a Phoenix issue that doesn’t seem to have been reported by anyone else based on my searches.
View modules are not recompiled after compiling error of unmatched tag in template files.
Compiling 1 file (.ex)
** (Phoenix.LiveView.Tokenizer.ParseError) lib/demo_web/components/layouts/root.html.heex:44:1: unmatched closing tag.
To fix it, I have to run mix clean
, start the dev server again.
I’m not sure if others have encountered this issue, or if this is just my specific situation.
I’ve already filed a bug report to Phoenix project, but I’m curious whether this is just something unique to my setup or if it’s an existing issue that others might have missed. If anyone has some time, could you help test this scenario and see if you can reproduce the same problem?
You can find the complete steps here:
opened 02:37PM - 12 Sep 25 UTC
## Environment
* Elixir version (elixir -v): 1.18.4
* Erlang/OTP version: 27.3.… 4.2
* Phoenix version (mix deps): 1.8.1
* Operating system: macOS 14.7.8
## Actual behavior
View modules are not recompiled after compiling error of unmatched tag in template files.
Following is the way to reproduce it.
### 1. generate a new project with phx_new 1.8.1
```
$ mix phx.new demo --no-ecto --no-live
$ cd demo
$ iex -S mix phx.server
```
### 2. edit `lib/demo_web/components/layouts/root.html.heex` to build unmatched tags
I changed `<html` to `<htmlxxx` at here:
```
<!DOCTYPE html>
<htmlxxx lang="en">
<head>
...
```
And, as we expected, it shown compilation error:
<img width="998" height="711" alt="Image" src="https://github.com/user-attachments/assets/2beefc6d-68fd-42bf-91d5-6683c61ddc88" />
### 3. change `lib/demo_web/components/layouts/root.html.heex` back
I changed `<htmlxxx` to `<html` at here:
```
<!DOCTYPE html>
<html lang="en">
<head>
...
```
And, as we expected, it should recompile the template, right? But, it shown:
<img width="997" height="785" alt="Image" src="https://github.com/user-attachments/assets/0398a85b-f558-4190-b37e-eed36c61bacc" />
### 4. to fix it?
To fix it, I have to run `mix clean`, start the dev server again.
I'm not sure if others have encountered this issue, or if this is just my specific situation - I don't know. But it's probably best to report it anyway.
## Expected behavior
View modules are recompiled after compiling error of unmatched tag in template files.
1 Like
axelson
September 12, 2025, 7:23pm
2
Ah, I think I’ve encountered that or a similar error. But was never able to find a reliable reproduction case for it. I’m glad you did and filed an issue for it