Edge
Special Edge Runtimes Compatibility Warning
Edge Runtimes Compatibility Warning
Edge environments, such as Cloudflare Workers, Vercel Edge Functions, and Cloudflare Pages, are only partially supported and have various limitations and caveats.
Since new Function
cannot be executed in edge environments, Translation Node Proxies created from a new function cannot be functions anymore. This means you won't be able to call them directly. Instead, you'll need to use methods like .use
or .get
to perform actions. Also some variable injections may not work as expected.
// From
const t = getTranslation();
t("hello");
t.greetings({ name: "John" });
// To
const t = getTranslation(); // Also hooks lose their proxy properties
t.get("hello"); // or t.hello
t.greetings.use({ name: "John" }); // .use and .get are the same
The upside is that, since these proxies become string objects rather than function objects, this offers better compatibility in some environments and eliminates the need for workarounds such as React Patch. However, this limitation only applies to edge environments.
The current solution is a temporary workaround. In the future, full compatibility will be achieved, as there are ways in JavaScript that can provide the desired behavior and even allow you to choose between string objects or function objects as needed, thus avoiding the need for workarounds like the React Patch.