workers-sdk: 🐛 BUG: The 'credentials' field on 'RequestInitializerDict' is not implemented.
Which Cloudflare product(s) does this pertain to?
Workers/Other
What version of Wrangler are you using?
2.6.2
What operating system are you using?
Windows
Describe the Bug
I am testing locally
EDIT: To emphasize, when I press L to test locally, it is working fine but when I deploy to Cloudflare or turn local mode off, it is showing the error.
Whenever I include credentials in the header of a fetch request, I am receiving this error.
This has became an issue since I ably-js has stopped working entirely throwing this error.
I use hono.js to simplify the usage of workers so basically a reproduction would be
import {Hono} from "hono"
app.get("/", ctx => {
new fetch("https://example.com/api/", {
headers,
method: "POST",
body: "",
credentials: headers.has("authorization") ? "include" : "same-origin"
})
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (2 by maintainers)
@KianNH I’ve just run into this problem in a SvelteKit app using the @sveltejs/adapter-cloudflare. I’m just wondering why the
credentialsfield isn’t supported? Are there any plans to support the full fetch request API? Other edge runtimes like Deno seem to have all properties.Running into this issue trying to use the
@huggingface/inferencepackageis it possible to not make this a hard crash? Given workers are not in a browser, the credentials policy shouldn’t affect them… so is there some harm to making this not hardcrash any third-party library that also wants to support a browser?
fucked my prod with this bug, all test passed in local ^^
Same issue:
The 'credentials' field on 'RequestInitializerDict' is not implementedIs there any workaround?
Similar issue here https://github.com/cloudflare/workerd/issues/698