Skip to content

The 'credentials' field on 'RequestInitializerDict' is not implemented when used in Cloudflare pages #799

Open
@veronica-severyn

Description

@veronica-severyn

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 })

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageA new issue that needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions