When running a Lighthouse check on my site, I received the following error under SEO:
Links are not crawlable
Search engines may use
hrefattributes on links to crawl websites. Ensure that the
hrefattribute of anchor elements links to an appropriate destination, so more pages of the site can be discovered. Learn More
The link that could not be crawled is
a#main-content, which is the "Skip to main content" link.
This is the page's HTML:
<a href="#main-content" class="visually-hidden focusable"> Skip to main content </a> ..navbar.. <a id="main-content" tabindex="-1"></a>
As far as I know, this structure is completely fine and doesn't present any real problems for Google or any other search engine. So what's the best way to address this error for this specific link?
I am trying to automate the Lighthouse reports in my CI pipeline, and I want to minimize the number of known errors.