Nitro provides out of the box support for deploying to Edge Workers.
Nitro provides out of the box support for deploying any Nitro app to different Edge Worker offerings as well as Service Workers.
Deploying to edge workers has some limitations. See limitations for more details.
- No support for raw TCP/IP traffic
- Execution time is limited compared to classic serverless offerings (normally 15-30 seconds)
- No access to the filesystem (use the nitro storage layer)
- Bundle size is very limited (normally a few MBs)
- Limited access Node.js APIs (nitro provides compatibility layer via unjs/unenv)
If you come across a library that you assume to be incompatible with edge workers, please open an issue on the nitro repo and help us keeping this list up to date.
The following libraries are known to be incompatible with edge workers because of one of the above mentioned limitations:
There are possible fixes for MongoDB, like using Realm and the Realm SDK or using http interfaces (only available when self hosting MongoDB), but these are untested. You can find an example for using realm here
You can find an example with a modified MySQL driver here