Webhook to Amplify returning 405 error

https://community.prismic.io/t/caching-issue-with-next-js-app-router-vercel-deployment

our app is still experiencing this issue, and what the webhook returns is 405 as the response header. We have deployed the app on amplify and I have this script in my build script

"scripts": {
    "build": "rm -rf .next/cache/fetch-cache && next build",
},

Please also find below my dependencies
Screenshot 2024-08-26 at 09.49.01

Please help, Thanks

Hi @nimbussp ,

405 means the method isn't allowed - ie: the type of request isn't allowed (GET,POST etc).

The revalidate route via Prismic webhooks requires a POST and it looks like Prismic sends a payload along with the request as well. Also make sure you're using /api/ in your route.

If you use anything but a POST to request the script you'll get a 405 instead.

So start with how your calling the revalidate script if its via the Prismic webhook... that should work fine.

Thanks.

Please check the breadcrumb of the above image, I have /api/revalidate

Screenshot 2024-08-26 at 11.32.04

And this is my webhook url as well.

I have not had any successful response ever since I setup this webhook

I noticed you are using Amplify and not Vercel. It seems ISR isn’t supported on Amplify:
https://www.reddit.com/r/nextjs/comments/11yxo3s/comment/jdba59n/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button