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

[Cloudflare] Error: The 'referrerPolicy' field on 'RequestInitializerDict' is not implemented. #9194

Closed
3 tasks done
typeofweb opened this issue Oct 6, 2023 · 5 comments · Fixed by #9200
Closed
3 tasks done
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug

Comments

@typeofweb
Copy link

typeofweb commented Oct 6, 2023

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.69.0

Framework Version

13.5.4

Link to Sentry event

No response

SDK Setup

No response

Description

When Sentry is used in Next.js on Cloudflare via next-on-pages, an error is thrown:

Error: The 'referrerPolicy' field on 'RequestInitializerDict' is not implemented.

This is due to this line of code:

@AbhiPrasad
Copy link
Member

Hey @mmiszy. Currently the Next.js SDK only supports Node.js and Vercel Edge runtimes. I would recommend you check out https://github.com/robertcepa/toucan-js for Cloudflare workers runtime support.

@james-elicx
Copy link

james-elicx commented Oct 7, 2023

Hey @mmiszy. Currently the Next.js SDK only supports Node.js and Vercel Edge runtimes. I would recommend you check out robertcepa/toucan-js for Cloudflare workers runtime support.

Hello @AbhiPrasad, couldn't you just use your supportsReferrerPolicy utility here to improve compatibility so that Next.js apps can be deployed to both Vercel and Cloudflare without requiring users have different libraries for each platform?? You yourself actually acknowledged improving support for Cloudflare in #8935 (comment).

I would also note that last month you guys made a change to one of your packages just to improve support for deploying to Cloudflare and using @sentry/nextjs. You can see @lforst's conversation about that with Dario in cloudflare/next-on-pages#420.

This doesn't seem like something that is much of a problem to add a check for.

@lforst
Copy link
Member

lforst commented Oct 9, 2023

@james-elicx Cloudflare + Next.js is currently something we do not officially support. We try to make things work in general but not specific to CFPs. We do not check for compatibility and also don't have tests for CFP.

This doesn't seem like something that is much of a problem to add a check for.

PRs are always welcome!

@lforst
Copy link
Member

lforst commented Oct 9, 2023

I am starting to wonder if we even need the referrerPolicy field here. I'll try and figure out why it was added 🤔

@AbhiPrasad
Copy link
Member

This change was released with https://github.com/getsentry/sentry-javascript/releases/tag/7.74.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants