i have this inside app/sitemap.ts
import { getData } from "@/lib/meta";
import { Blog } from "@/utils";
export default async function sitemap() {
const posts = await getData();
const baseUrl = "https://enigma.fm";
const postUrls = posts.map((post: Blog) => ({
url: `${baseUrl}/community/blogs/${post.slug.current}`,
lastModified: new Date(post.publishedAt),
}));
const uniqueAuthors = new Set(
posts.map((post: Blog) => post.author.slug.current)
);
const authorUrls = Array.from(uniqueAuthors).map((authorSlug) => ({
url: `${baseUrl}/community/author/${authorSlug}`,
lastModified: new Date(),
}));
return [
{
url: baseUrl,
lastModified: new Date(),
},
{
url: `${baseUrl}/pricing`,
lastModified: new Date(),
},
{
url: `${baseUrl}/profile`,
lastModified: new Date(),
},
{
url: `${baseUrl}/signup`,
lastModified: new Date(),
},
{
url: `${baseUrl}/signin`,
lastModified: new Date(),
},
{
url: `${baseUrl}/success`,
lastModified: new Date(),
},
{
url: `${baseUrl}/privacy`,
lastModified: new Date(),
},
{
url: `${baseUrl}/refund`,
lastModified: new Date(),
},
{
url: `${baseUrl}/terms`,
lastModified: new Date(),
},
{
url: `${baseUrl}/community`,
lastModified: new Date(),
},
...postUrls,
...authorUrls,
];
}
i was trying to dynamically generate sitemaps with the help of the docs from next js, so the sitemaps are perfectly fine on development but it gives this error while i try to deploy it to the vercel