Next.js can't create static pages

I got this error message I've been working on for several hours. And I can't get wise on it. In my code, I take the params and get the store that matches those params. I feel like it can't fetch the related store. which I find rather strange since well it works so well in dev. I wish I could give more about it, but I'm not sure how to explain it, hoping that someone takes the time to look at the error message. it seems to me, that there is some place it expects and interger and therefore it fails, but it should be wise versa. since I do not call any functions that needs and integer before I got my store. + usually the error starts from the top. Will add the code below in comments
2 Replies
NorthBit (Joakim)
export async function getStaticPaths() { const storePaths = await getStorePaths() console.log(storePaths) return { paths: storePaths, fallback: true, } } export async function getStaticProps({ params }: any) { try { let products; let filters; const store: any = await getStore(params.slug, params.city).then(async (res) => { if (res) { res[0].likes = await getStoreLikes(res[0].store_id) res[0].followers = await getStoreFollowers(res[0].store_id) products = await initialize(res[0].store_id) filters = await getStoreProductfilters(res[0].store_id) } return res }) return { props: { store: store[0], products: products, filters: filters, }, } } catch (err: any) { console.log(err.message) } }
Want results from more Discord servers?
Add your server