From f5ffcd60c86ea42a01a1bedef4e71f3ef16074c9 Mon Sep 17 00:00:00 2001 From: Byungjin Lee Date: Wed, 10 Sep 2025 12:03:15 +0900 Subject: [PATCH 1/2] docs: Add FinalizationRegistry touble-shooting --- pages/cloudflare/troubleshooting.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pages/cloudflare/troubleshooting.mdx b/pages/cloudflare/troubleshooting.mdx index 537e9be..c95c7b0 100644 --- a/pages/cloudflare/troubleshooting.mdx +++ b/pages/cloudflare/troubleshooting.mdx @@ -125,3 +125,23 @@ X [ERROR] Could not resolve "" It might be because the package contains workerd specific code. Check this [howto](/cloudflare/howtos/workerd) for a solution. + +### `ReferenceError: FinalizationRegistry is not defined` + +If you encounter this error when using features that rely on modern JavaScript APIs: + +```text +✘ [ERROR] ⨯ ReferenceError: FinalizationRegistry is not defined +``` + +This error occurs because the `FinalizationRegistry` API is not available in older Cloudflare Workers compatibility dates. + +To fix this issue, update your `compatibility_date` in `wrangler.toml` or `wrangler.jsonc` to `2025-05-05` or later: + +```json +{ + "compatibility_date": "2025-05-05" +} +``` + +Refer to the [Cloudflare Workers compatibility flags documentation](https://developers.cloudflare.com/workers/configuration/compatibility-flags/#enable-finalizationregistry-and-weakref) for more details. From 2ddf5c79980d8972b8c89de25f9b3f9026bd7c71 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 10 Sep 2025 08:30:30 +0200 Subject: [PATCH 2/2] fixup! format --- pages/cloudflare/troubleshooting.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/cloudflare/troubleshooting.mdx b/pages/cloudflare/troubleshooting.mdx index c95c7b0..686206d 100644 --- a/pages/cloudflare/troubleshooting.mdx +++ b/pages/cloudflare/troubleshooting.mdx @@ -134,7 +134,7 @@ If you encounter this error when using features that rely on modern JavaScript A ✘ [ERROR] ⨯ ReferenceError: FinalizationRegistry is not defined ``` -This error occurs because the `FinalizationRegistry` API is not available in older Cloudflare Workers compatibility dates. +This error occurs because the `FinalizationRegistry` API is not available in older Cloudflare Workers compatibility dates. To fix this issue, update your `compatibility_date` in `wrangler.toml` or `wrangler.jsonc` to `2025-05-05` or later: