I had a similar issue and after a few hours, I figured out that Next.js kept redirecting the URL from no slash to trailing slash back to no slash and so on. Try adding a trailing slash in the URL you are using and a leading slash so it's an absolute URL and not a relative one.