Hey guys! I’m building a Next.js app with the Page...
# general
i
Hey guys! I’m building a Next.js app with the Pages Router, and I’m stuck on the React Ory elements. When I try to access the
/auth/login
page, I keep getting redirected to
<http://localhost:3000/self-service/login/browser>
and seeing this error: "TypeError: fetch failed" It seems like it might be related to the request below. I think because it’s running on localhost, the login page doesn’t get the
flow
ID in the search params. Request URL:
<http://localhost:3000/sessions/whoami>
b
Hi, did you add the middleware.ts file?
i
yes, i used the one provided from documentation. before I used my own version which checks for protected routes with ory.toSession. in both cases it was still working yesterday, seems like it suddenly stopped working. initially i thought because of my change, but removed all of the changes, checked out to main, even cleared cache, cookies, node_modules, tried in incognito and different browsers. I'm out of ideas now
b
The request should show up in the network tab of the dev tools. What is its response?
i
got this in network tab
b
What's the response text?
and are there any logs in the next js application?
i
there was nothing, but I finally got it working. I deleted the repo and cloned it again, I think it might have been related to some internal nextjs issues, not ory itself. does that ring a bell by any chance?