Next.js Discord

Discord Forum

next-sitemap doesn't work with next-auth

Unanswered
Michalx0x posted this in #help-forum
Open in Discord
repo: https://github.com/Skolaczk/next-starter
After adding next-auth to my app next-sitemap doesn't generate sitemap properly. The result of building the app before and adding next-auth to the photos.
Does anyone have an idea how to fix this?

I tried adding this line to sitemap.config.js:
exclude: ['/api/auth/*']
, but it didn't help.

Sitemap before adding next-auth:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://localhost:3000/sitemap-0.xml</loc>
</sitemap>
</sitemapindex>


Sitemap after adding next-auth:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> </sitemapindex>

0 Replies