Page Router ISR issue
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
I have a page router app running on next v14.2.23. Its also integrated with plasmic and sanity. To keep the cost down of ISR we have revalidate set up to false inside of
My issue, is that I cant seem to revalidate the path after updates in plasmic. This is what I have set up in our webhook
Any suggestions on what I could be doing wrong with invalidating paths so they can get rebuild?
Thanks in advance, and we are on vercel hosting
getStaticProps
My issue, is that I cant seem to revalidate the path after updates in plasmic. This is what I have set up in our webhook
if (req.query.path) {
const paths = Array.isArray(req.query.path)
? req.query.path
: [req.query.path]
for (const path of paths) {
const paths = generateAllPaths(path)
const seedPaths = generateAllPaths(path)
for (const seedPath of seedPaths) {
try {
await res.revalidate(seedPath, {
unstable_onlyGenerated: false,
})
console.log(seedPath)
} catch (err) {
console.error(`Error revalidating ${seedPath}:`, err)
}
}
}
return res.json({ revalidated: true })
}
unstable_onlyGenerated
was something I found online. And when testing with yarn build and yarn start it seems to work, but as soon as we try it in production on vercel hosting it does not clear the paths. Any suggestions on what I could be doing wrong with invalidating paths so they can get rebuild?
Thanks in advance, and we are on vercel hosting