sitemap headers error
Unanswered
American Shorthair posted this in #help-forum
American ShorthairOP
I'm getting this error from google and xml file validator website..
here is my sitemap.ts code
here is my sitemap.ts code
29 Replies
I would take a look at this. Can you provide the xml outiout as well?
@Jboncz https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap
American ShorthairOP
I've done the same thing
@joulev Click to see attachment
American ShorthairOP
What, then why does it give me errors, can you send me that website link?
American ShorthairOP
Do you know what could be the reasons it keeps returning couldn't fetch in google search console?
i don't know. currently as far as i can see, your sitemap is perfectly fine.
American ShorthairOP
@joulev i don't know. currently as far as i can see, your sitemap is perfectly fine.
American ShorthairOP
hmmm
if you go to the sitemap in your browser and open the network tab (and optionally reload again if needed), do you see the response header as application/xml?
because i do see it as application/xml
(you can also use postman for this, no need of a browser)
@joulev because i do see it as application/xml
American ShorthairOP
that seems like too few headers huh
how about postman?
@joulev how about postman?
American ShorthairOP
lemme try
@joulev how about postman?
American ShorthairOP
weird
@American Shorthair Click to see attachment
that looks 100% good, nothing wrong...
now i can only guess that either your middleware or some platform things intercepted the request and returned a different things for crawlers
@joulev now i can only guess that either your middleware or some platform things intercepted the request and returned a different things for crawlers
American ShorthairOP
maybe yea, lemme try different browser
still, idk honestly
but why google can't fetch it
What he said it seems fine. Def middleware or some other rule causing the issue. Throw a log message in your middleware and see if it is getting hit when you pull the site map