Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find the error file? #136

Open
GoulartNogueira opened this issue Sep 23, 2021 · 3 comments
Open

How to find the error file? #136

GoulartNogueira opened this issue Sep 23, 2021 · 3 comments
Labels
question Further information is requested

Comments

@GoulartNogueira
Copy link

GoulartNogueira commented Sep 23, 2021

Problem:

I can't find the exact problem pointed by @nuxtjs/html-validator.

Expected:

To have more detail for each error, like the filename, or at least the surrounding code.


I have a big medium-size project with dozens of pages and components.

I've just installed @nuxtjs/html-validator and run.
It has successfully found some errors:

 ERROR  HTML validation errors found for /my-url-route

inline
  591:375   error  <h1> cannot be empty, must have text content                        empty-heading
  591:649   error  Anchor link must have a text describing its purpose                 wcag/h30
  593:866   error  <input> is missing required "type" attribute                        element-required-attributes
  593:866   error  <input> element does not have a <label>                             input-missing-label

As I have only 1 <h1> tag, it was easy to find the first bug, but as I use lot's of components, in some cases, I can't know exactly where the problems are.

I feel like I'm missing something fundamental here. Am I not using the took correctly?

@GoulartNogueira GoulartNogueira added the question Further information is requested label Sep 23, 2021
@danielroe
Copy link
Collaborator

Apologies for the delay in replying.

The issue is that we are validating the entire HTML response from the Nuxt server, which means there is no particular clue where the component is. If you use the prettier option, we should log the code around each error which means you may have more information.

PRs or suggestions welcome to improve this behaviour.

@joaopedrodcf
Copy link

The solution of using prettier: true works really well for me, it prints more things and this way we can find the html error easily.

@BenoitEirik
Copy link

BenoitEirik commented Feb 1, 2024

Can't use prettier: true with TailwindCSS. Any solution to find file errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants