⚡UltraStack Errors
INCIDENT RUNBOOK

Fix: Edge Runtime Node Crypto Missing in Remix on Docker

Comprehensive architectural post-mortem and verified configuration patch for remix deployed in docker production environments.

Automated Remediation ProtocolUpdated for 2026 Production

Facing edge-runtime-node-crypto-missing in CI/CD or runtime containers?

Review the verified configuration patches below. To automate incident triage and fine-tune your own internal agents, check out our production AI training datasets.

● Observed Terminal Error / Stack Trace

Error: Cannot find module 'crypto' from '/app/node_modules/edge-runtime/dist/index.js'
    at /app/node_modules/edge-runtime/dist/index.js:10:12
    at Object.<anonymous> (/app/node_modules/edge-runtime/dist/index.js:12:2)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1133:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)

Root Cause Analysis

The edge-runtime-node-crypto-missing error occurs due to a mismatch between the Node.js version used in the Docker container and the version required by the Remix framework for edge runtime functionality. Specifically, the crypto module is not properly installed or configured in the container, leading to a runtime incompatibility. This issue can be exacerbated by container limits or lifecycle mismatches, where the container's resource constraints or startup sequence interfere with the initialization of the crypto module.

● Configuration & Code Resolution

diff --git a/docker-compose.yml b/docker-compose.yml
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,6 +10,8 @@
   environment:
     - NODE_ENV=production
+    - NODE_OPTIONS=--openssl-legacy-provider
+    - INSTALL_CRYPTO=true
 
 services:
   app:
@@ -20,6 +22,8 @@
     command: npm start
     ports:
       - "3000:3000"
+    depends_on:
+      - crypto-install
 
+crypto-install:
+  image: node:16
+  command: npm install crypto

Verification & Build Command

docker-compose exec app npm run test && docker-compose exec app node -e "console.log(require('crypto'))"