Skip to content

Commit 65d8644

Browse files
ByungJin-Leevicb
andauthored
docs(cloudflare): Add FinalizationRegistry trouble-shooting (#182)
Co-authored-by: Victor Berchet <victor@suumit.com>
1 parent c88206c commit 65d8644

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pages/cloudflare/troubleshooting.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,23 @@ X [ERROR] Could not resolve "<package name>"
125125
It might be because the package contains workerd specific code.
126126

127127
Check this [howto](/cloudflare/howtos/workerd) for a solution.
128+
129+
### `ReferenceError: FinalizationRegistry is not defined`
130+
131+
If you encounter this error when using features that rely on modern JavaScript APIs:
132+
133+
```text
134+
✘ [ERROR] ⨯ ReferenceError: FinalizationRegistry is not defined
135+
```
136+
137+
This error occurs because the `FinalizationRegistry` API is not available in older Cloudflare Workers compatibility dates.
138+
139+
To fix this issue, update your `compatibility_date` in `wrangler.toml` or `wrangler.jsonc` to `2025-05-05` or later:
140+
141+
```json
142+
{
143+
"compatibility_date": "2025-05-05"
144+
}
145+
```
146+
147+
Refer to the [Cloudflare Workers compatibility flags documentation](https://developers.cloudflare.com/workers/configuration/compatibility-flags/#enable-finalizationregistry-and-weakref) for more details.

0 commit comments

Comments
 (0)