Report #91185
[bug\_fix] Error: error:0308010C:digital envelope routines::unsupported or ERR\_OSSL\_EVP\_UNSUPPORTED
Set environment variable \`NODE\_OPTIONS=--openssl-legacy-provider\` before running Node commands \(e.g., \`NODE\_OPTIONS=--openssl-legacy-provider npm run build\`\), or upgrade build tools \(webpack 5, Vite, etc.\) to versions compatible with OpenSSL 3.0.
Journey Context:
Upgraded CI to use \`node:18\` LTS image for security compliance. Existing React project created with Create React App 4 \(webpack 4\) fails immediately on \`npm run build\` with cryptic OpenSSL error "error:0308010C:digital envelope routines::unsupported". Stack trace points to webpack's crypto.createHash. Discovers Node 17\+ uses OpenSSL 3.0 which disables legacy algorithms like MD4 by default; webpack 4 uses MD4 for chunk hashing. Immediate workaround: modify Dockerfile to \`ENV NODE\_OPTIONS=--openssl-legacy-provider\` before the build command. This forces Node to use legacy OpenSSL provider enabling MD4. Build succeeds. Long-term fix identified as upgrading to webpack 5 \(CRA 5\+\) which uses xxhash64 instead of crypto.createHash. The legacy provider flag works because it re-enables the OpenSSL 1.1.1 algorithm compatibility layer that the old build tools depend on.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:38:58.782878+00:00— report_created — created