-
Notifications
You must be signed in to change notification settings - Fork 46
[BUG] Normal request somehow getting "purpose = prefetch" header #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is caused by this https://github.com/opennextjs/opennextjs-aws/blob/73281c958d43d865fdded0d5d86dd82747365fee/packages/open-next/src/core/requestHandler.ts#L159-L164 We could move this to use a code patch now |
Thanks Mate for jumping in. |
For now use something like pnpm patch to remove these lines https://github.com/kinde-oss/kinde-auth-nextjs/blob/d221023de87008ca1115ab2bcf9598ba79106df9/src/handlers/login.ts#L12-L14. |
Hey |
It should be in the beta.3 |
Uh oh!
There was an error while loading. Please reload this page.
Initially I thought it is about build,but found out it is not.
I am trying to move to Cloudflare with OpenNext.
I am using Kinde for auth (working great on Vercel).
Unfortunately, as they have a check for prefetch on login handler (other routes work ok) - https://github.com/kinde-oss/kinde-auth-nextjs/blob/main/src/handlers/login.ts#L12
After adding many debug logs in node_modules code, I managed to find out that in some way, when the request hit the handler, it has "purpose = prefetch" header set, which cause the handler to think it is prefetch and return null.
I was trying to figure out what is going on, but I cannot find any reason how this can happen.
Above you can find a screenshot from my debugging attempt.
dead simple logs put inside node_modules.
Any idea what can be going on here?
The text was updated successfully, but these errors were encountered: