You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/cloudflare/troubleshooting.mdx
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,3 +125,23 @@ X [ERROR] Could not resolve "<package name>"
125
125
It might be because the package contains workerd specific code.
126
126
127
127
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