Thilina Sandaruwan
Thilina Sandaruwan

Reputation: 337

Error generating route "/": HTML minification failed. Nuxt js

I developed a nuxt app and it works perfectly when run with "npm run dev". But when I generating the site with "npx nuxt generate" console shows following error. I cant find the error. Please help me. enter image description here

Upvotes: 2

Views: 1792

Answers (3)

DanielHefti
DanielHefti

Reputation: 344

I had the same issue. In my case it was caused by a wrong <br> - tag.

I've used `</ br>` instead of `<br />`. 

A short annotation. Chrome accepts </br > - tag and renders the page like expected, but the html minifaction does not work properly.

Upvotes: 2

Max
Max

Reputation: 934

Mine was actually because I had some form of "<" and ">" which probably interfered with the HTML (?)

Upvotes: 2

Thilina Sandaruwan
Thilina Sandaruwan

Reputation: 337

I have solved the problem. There were two reasons for that in my case.

  1. There were some css classes in html which are not defined in css file.
  2. There were pictures with broken links and some are not exist in source folder.

Upvotes: 2

Related Questions