Closed OmnomnomTee closed 7 months ago
Hey buddy,
Thanks for reporting this issue. I have tried to reproduce it at first but couldn't make this bug appear but instead I was getting issues like:
HTML validation errors found for /
inline
2:2 warning <html> is missing required "lang" attribute element-required-attributes
3:2 error <head> element must have <title> as content element-required-content
✖ 2 problems (1 error, 1 warning)
More information:
https://html-validate.org/rules/element-required-attributes.html
https://html-validate.org/rules/element-required-content.html
Which looks correct as my app only contained a string: Check out the browser network tab to see what Response Headers has been set for you by nuxt-security module
.
Then I looked at your code and realised that you are using NuxtWelcome
component instead of some text. If I put this component there instead, I can reproduce this error.
Not sure however how to solve this problem as this NuxtWelcome
component comes from Nuxt and serves as a Hello World example.
Are you experiencing this issue in any other example?
It looks like Cheerio is modifying Vue data-v-...
tags to data-v-...=""
, and @nuxtjs/html-validator complains about this.
This is absolutely valid HTML though, I do not understand why html-validator has a parser issue with this.
Is there a way you can setup html-validator to not complain about empty string attributes ?
Thanks for the fast reply!
@Baroshem I am currently using both modules for the rewrite of my portfolio website, but it is not open source yet, which is why I created the minimal project on Stackblitz. I will open source the repo sometime this week, as I am also having another issue regarding the Vercel build pipeline and the nuxt-security module.
@vejja Thanks for the hint regarding Cheerio. I will take a look at the @nuxtjs/html-validator configuration options. Apparently it uses html-validate under the hood. The configuration options can be found here: https://html-validate.org/rules/index.html
I will report back when i know more.
Hey @OmnomnomTee
Thanks for the reply, let us know once you will have more details.
Also, thanks @vejja for hints :)
Just a brief update, disabling the html-validate rules did not address the issue. I am currently taking a deeper look, but have not as much time as I would want. Will keep you posted.
Ok no worries. Let us know if we can help somehow and with the further progress on this :)
@OmnomnomTee
Any progress? :)
Closing the issue. If it will be needed, please do not hesitate to reopen it and provide additional details so that we can help :)
Version
nuxt-security: v1.0.0 nuxt: v3.9.0 @nuxtjs/html-validator: v1.6.0
Reproduction Link
Default nuxt project with nuxt-security and @nuxtjs/html-validator modules, available on stackblitz.
https://stackblitz.com/edit/nuxt-security-html-validator-bug?file=nuxt.config.ts
Steps to reproduce
What is Expected?
Project builds without errors, when enabling the nuxt-security module.
What is actually happening?
Getting a html-validator error, when the module is activated.