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

[🐛 Bug]: "Error: The 'referrerPolicy' field on 'RequestInitializerDict' is not implemented." #487

Closed
1 task
typeofweb opened this issue Oct 6, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@typeofweb
Copy link

typeofweb commented Oct 6, 2023

next-on-pages environment related information

System:
	Platform: darwin
	Arch: arm64
	Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
	CPU: (8) arm64 Apple M1 Pro
	Memory: 16 GB
	Shell: /bin/zsh
Binaries:
	Node: 20.6.0
	Bun: N/A
	pnpm: 8.8.0
	Yarn: N/A
	npm: 9.8.1
Package Manager Used: pnpm
Relevant Packages:
	@cloudflare/next-on-pages: 1.6.3
	vercel: N/A
	next: 13.5.4

Description

First request usually works. Then, refreshing the page or opening it in a new tab throws the following error:

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

If I wait a few minutes and refresh, it works again but just once. This gives me a hunch it's something about the cache maybe?

It happens both on Cloudflare as well as locally when using wrangler pages dev.

Error: The 'referrerPolicy' field on 'RequestInitializerDict' is not implemented.
    at $ (file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:15:2103)
    at file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:5:1178
    at file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:3:4700
    at file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:3:3737
    at Array.map (<anonymous>)
    at file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:3:3730
    at new Promise (<anonymous>)
    at ee.drain (file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:3:3660)
    at Object.flush (file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:5:1052)
    at file:///private/var/folders/gc/311x73xj7sd9cktxzv9r0kk00000gn/T/tmp-58358-0unFygPsVvAt/__next-on-pages-dist__/webpack/00a5d258dd6c57effb2ee12c80334a1e.js:2:5656 {
  stack: Error: The 'referrerPolicy' field on 'RequestIniti…ebpack/00a5d258dd6c57effb2ee12c80334a1e.js:2:5656,
  message: The 'referrerPolicy' field on 'RequestInitializerDict' is not implemented.
}

Pages Deployment Method

Pages CI (GitHub/GitLab integration)

Pages Deployment ID

3255a5ad-f60d-418e-b795-4214680de433

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@typeofweb typeofweb added the bug Something isn't working label Oct 6, 2023
@james-elicx
Copy link
Contributor

Hi there,

Are you able to share some more context by any chance - what are you doing where this happens?

Are you intentionally trying to use a referrerPolicy property somewhere? If you are, is there another way for you to accomplish what you are doing, as referrerPolicy is not implemented on RequestInit in workerd.

If you aren't trying to use referrerPolicy yourself, would it be possible for you to share a reproduction, or information about what exactly is happening when this error is thrown?

@typeofweb
Copy link
Author

I am not trying to intentionally use it.
I'll try to prepare a minimal reproduction today.

@typeofweb
Copy link
Author

typeofweb commented Oct 6, 2023

@james-elicx
Copy link
Contributor

It's caused by this line in Sentry: getsentry/sentry-javascript@945d873/packages/vercel-edge/src/transports/index.ts#L86

Should Toucan.js be used in next-on-pages instead?

getsentry/sentry-javascript#9194

Thanks for digging into the source of the problem. Looking at it, this is an issue that they should fix in their SDK with a simple check for referrerPolicy support.

It seems strange to me that the maintainer who replied to your issue has chosen this simple check as the point where they don't want to improve compatibility for Cloudflare when they made a more significant change last month to help us fix #420.

@typeofweb
Copy link
Author

Fixed on Sentry side

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

No branches or pull requests

2 participants