#Astro Sitemap Invalid type returned by Astro page.

2 messages · Page 1 of 1 (latest)

green hatch
#

Hey, so I have a page called [user].astro and it's causing a problem with the sitemap plugin. Trying to load the sitemap results in the following error:

OnlyResponseCanBeReturned
Invalid type returned by Astro page.
Route /[user] returned a undefined. Only a Response can be returned from Astro files.

So I guess I've two options, neither of which I understand how to handle as I don't see any reference to them on the docs:

Option A: blacklist this page from the sitemap
Option B (preferred): Somehow feed the sitemap all the possible options.

My website allows users to create profiles, and this is that page. I think it'd be nice to be able to index that for users?

Any advice would be awesome, having major SEO problems where were not showing on google or bing and I'm trying to fix that.

silver yarrow
#

While sitemaps can help, I believe links on your own site are much more valuable. e.g. Make sure these user pages are linked from other pages on your site, that Google already indexes.

I'm not sure how to pass dynamic routes here, because I'm assuming this route is SSR?