I have some routes I am generating with getStaticPaths(). I am hitting the storyBlok api to generate these routes. I am getting all routes but for some reason I keep getting a warning about an additional GET request for '/undefined' as a route. I can't seem to resolve or even find where it is coming from. Just want to have clean routes. Seems to be when getStaticPaths() is returning the slug params. Not sure if it is something with mapping over or what.
export async function getStaticPaths() {
const storyblokApi = useStoryblokApi()
const { data } = await storyblokApi.get('cdn/stories', {
level: 1,
excluding_slugs: 'home',
version: import.meta.env.DEV ? "draft" : "published",
resolve_links: 'url'
})
const pages = Object.values(data.stories)
// console.log(pages.length)
// console.log("PAGES:", pages)
return pages.map((page: any) => {
return {
params: { slug: page.slug },
props: { page },
}
});
}