I encountered some ambiguity in the Next.js documentation, which didn't provide much help for my issue - I'm facing challenges with the getStaticPaths function. Below is the code snippet causing trouble:
export async function getStaticPaths() {
let res = fetch("localhost:3000/api/main")
const paths = res.json().map(state => ({
params: {id: states.id},
}))
return {paths,
fallback: false}
}
Any insights on why this isn't functioning as expected? I also have a getStaticProps function that successfully loads res.json()