What is an edge runtime?
An edge runtime is a server environment that runs your code closer to the user — on servers distributed around the world rather than in one central data center. Examples include Cloudflare Workers, Deno Deploy, Bun, and Next.js edge routes. Edge runtimes are fast and lightweight, but they are sandboxed — they intentionally strip out many Node.js APIs to keep the environment small and secure. In particular, they have no access to the file system (fs) and no path module.
Why does this affect IlanaORM?
By default, when you import IlanaORM, it automatically looks for and loads your ilana.config.js file using Node.js fs and path. This works perfectly in a normal Node.js server, but it crashes immediately in an edge runtime because those APIs don’t exist there.
IlanaORM solves this with a separate edge entry point that skips the auto-loader entirely. Everything else — models, queries, relations, transactions — works exactly the same.
Usage
Import fromilana-orm/edge instead of ilana-orm:
Database.configure() yourself before using any models:
Cloudflare Workers
Next.js Edge Routes
What works and what doesn’t
| Feature | Standard (Node.js) | Edge |
|---|---|---|
ilana.config.js auto-load | ✅ Automatic | ❌ Skipped — configure manually |
Database.configure() | Optional | Required |
| Models, queries, relations | ✅ | ✅ |
| Transactions | ✅ | ✅ |
npx ilana migrate | ✅ | ❌ CLI is Node.js only |
| Seeders | ✅ | ❌ CLI is Node.js only |
Migrations and seeders are Node.js CLI tools — they run on your machine or in CI before deployment, not inside the edge worker. Run
npx ilana migrate during your deploy pipeline, then point the edge worker at the already-migrated database.