这是我的函数,用于获取将在本地开发模式下运行的路径
export async function getStaticPaths(){
const datas = await fetch(`https://mydomain.vercel.app/api/annonces/annonces`)
const annonces = await datas.json()
const paths = annonces.map(item =>({
params: {annonce: item._id}
}))
return {
paths,
fallback: false
}
}
这是我部署应用程序时的错误
> Build error occurred
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)