Next.js Discord

Discord Forum

Link to Sitemap causing an error

Unanswered
Turkish Van posted this in #help-forum
Open in Discord
Turkish VanOP
I have a link to sitemap.xml inside my navigation, and I am doing it using the Link component.
<Link href="/sitemap.xml">Sitemap</Link>

The error happens when a Link component enters the user's viewport. I tried fixing it by setting prefetch={false}. It results in an error occurring on the navigation to it.

It is not causing an error inside the browser, but there is an error inside the console.

Error inside of console:
TypeError: a[e] is not a function

What would be the correct way to handle this?

1 Reply

you can use an HTML anchor
<a href="/sitemap.xml">Sitemap</a>
maybe its how Link handle the static files