I want to deploy an existing remix site to the edge. I used export const config = { runtime: "edge" }; as described in the documentation but got this error:
The Edge Runtime isn’t exactly the same as the Node.js Runtime. It looks like you’ve run into a compatibility issue since the code uses unsupported APIs. The fastest solution is to just switch back to Node instead of Edge functions. But if you’re up for some code changes, you can find the list of supported APIs here: Edge Runtime
I could solve the errors by replacing @remix-run/node with @vercel/remix as described in the docs. But remix-i18next module is not supported. I get this error now:
Error: The Edge Function "login" is referencing unsupported modules:
- __vc__ns__/0/build/server/edge-eyJydW50aW1lIjoiZWRnZSJ9/index.js: remix-i18next/server, remix-i18next/react
I think it’s important to solve this issue if you want to support Remix in edge functions for business apps. Right now is like having a Ferrari without the wheels.
Edge function is mostly attractive for applications deployed globally where internationalization is important and remix-i18next is the most used i18n library in Remix. I mentioned it to Lee Robinson here.