Skip to content
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 'credentials' field on 'RequestInitializerDict' is not implemented when used in Cloudflare pages #799

Open
veronica-severyn opened this issue Sep 17, 2024 · 1 comment
Labels
bug Something isn't working triage A new issue that needs triage

Comments

@veronica-severyn
Copy link

veronica-severyn commented Sep 17, 2024

Package containing the bug

I’m not sure

Describe the bug

Usage of fetcher with credentials attribute is breaking production build if deployed on Cloudflare pages.

Using:

  • next-drupal: 2.0.0-beta.0
  • next: 14.2.7
  • @cloudflare/next-on-pages: 1.13.2
  • wrangler: 3.73.0

Expected behavior

A clear and concise description of what you expected to happen.

Steps to reproduce:

  1. Use "getResourceCollection" or "getResourceByPath" calls to retrieve the data from Drupal
  2. Local development works fine and the issue goes unnoticed
  3. Deploy the project to Cloudflare pages
  4. The routes are broken 😢

Additional context

This is the issue reported cloudflare/workers-sdk#2514 where it states that the Cloudflare workers do not support "credentials" property.

Can a workaround be implemented similar to this? E.g. check if it is supported and only then add or skip the "credentials" property alltogether.

const isCredentialsSupported = "credentials" in Request.prototype; 
fetch("...", { credentials: isCredentialsSupported ? "include" : undefined })
@veronica-severyn veronica-severyn added bug Something isn't working triage A new issue that needs triage labels Sep 17, 2024
@mithun-0111
Copy link

Hi @veronica-severyn, Any workaround have you found for the same as I am blocked with same issue ?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage A new issue that needs triage
Projects
None yet
Development

No branches or pull requests

2 participants