-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
The 'cache' field on 'RequestInitializerDict' is not implemented - Cloudflare Workers #1001
Comments
I encountered same problem on cloudflare pages hosted sveltekit app. Seems like it was introduced with this bump of auth-js https://github.com/supabase/supabase-js/releases/tag/v2.41.1 actuall this release introduced another problem https://github.com/supabase/auth-js/releases/tag/v2.63.0
Even if you are not using getSession() anywhere because SupabaseClient itself uses it I see getAccessToken here is using getSession and its used with fetchWithAuth here invoked on SupabaseClient's constructor here Downgrading the version was a work around so I'm using
to solve this problem |
Thanks for the comment. I tried downgrading to the from you specified supabase-js version. I also tried using other older versions of the supabase-js package and downgrading to another older wrangler version. This sadly all resulted in the same issue for me (Wrangler Cloudflare Worker). How can this even be possible? I am 100% sure I deleted the |
Remark. Was able to temporarily fix it by specifying the {
"@supabase/auth-js": "^2.62.0",
"@supabase/supabase-js": "2.39.8"
/* other packages */
} Edit: Sometimes only including "overrides": {
"@supabase/auth-js": "^2.62.0"
}
|
I have the same issue, the latest working version for me is |
This is causing Supabase Auth not to work when deployed to Cloudflare. Reverting back to an older version of supabase-js seems to be a temporary workaround. |
@raventos. This is super weird. When I use that fix on a new cloudflare worker project it works and the bug is gone. |
There is something extremely weird, I suspect it relates to how npm works. I now created a new hello world project, copied all the files from the working project to this one, and the bug returned. I then copied the node_modules folder from the working project to the new one, and the new one started to work again. |
The issue is present and in version |
I have the same issue. How do we solve this error? |
For now the only solution that worked for me was to add the following to package.json: and |
@nechmads |
If you're using the right version of the package, you shouldn't have to override.
Version 2.39.8 will only have access to the gotrue 2.62.2 version. Just make sure to uninstall then reinstall it. Hoping this gets fixed soon. J |
@jdgamble555 This might be a solution for a group of people but for @nechmads and me downgrading was for some reason not enough. And yes I made sure to clear the package cache, regenerate a |
@davbauer The solution was to also add: |
@nechmads I am very well aware of that if you look at my previous/edited comments days ago. I was just saying that for some people like you and me downgrading alone is not enough. |
"Error: The 'cache' field on 'RequestInitializerDict' is not implemented."
Cloudflare, nextjs, next-on-pages |
You can override the Check the |
I failed to notice I was using createServerClient from /ssr, which unfortunately doesn't have this option. Would appreciate some guidance on what to do then. |
Hi @hf thanks for your helpful input! The I am using:
This is the error:
And also would appreciate some guidance on this. |
addition:
|
I downgraded to |
Fixes supabase/supabase-js#1001 Hopefully the NextJS caching takes in the Authorization header in the cache key.
Still getting the error on "@supabase/auth-js": "^2.64.0" |
Works in |
I get the same thing now with @axiomhq/js :( |
Bug report
Describe the bug
When using the following method
supabase.auth.getUser(jwt?: string)
in my wrangler clouflare workers api I get following error:
To Reproduce
I am using wrangler cloudflare worker and I am using hono for routing, but either way these lines should trigger the error:
After that data is null and error includes the error, which is pasted above.
Expected behavior
It should just get the user as usual, this problem occurred just since today for me.
Screenshots
System information
Additional context
Also not sure if its an issue from cloudflare wrangler itself.
Reference to issue: cloudflare/workerd#698
Would be cool to know if there is anything I can do, since I am not able to continue from there on.
For some reason I never stumbled into that problem 3 days ago and I have not changed any files / package versions, which I can verify by my git history and also recloning my project.
Could it be that something got updated from the server-side of supabase which my cloudflare worker can not handle anymore?
Thank you!
The text was updated successfully, but these errors were encountered: