Report #46564
[bug\_fix] Error: error:0308010C:digital envelope routines::unsupported at new Hash \(internal/crypto/hash.js:136:19\) at Object.createHash \(crypto.js:111:10\) at module.exports \(/app/node\_modules/webpack/lib/util/createHash.js:135:53\)
Set environment variable NODE\_OPTIONS=--openssl-legacy-provider before running the build command, or upgrade webpack to version 5 \(or the build tool to a version supporting OpenSSL 3.0\). Root cause: Node.js 17 and later use OpenSSL 3.0, which disables legacy cryptographic algorithms by default. Old versions of webpack 4 and other build tools use crypto.createHash with algorithms that OpenSSL 3.0 considers legacy/unsupported.
Journey Context:
Developer upgrades local Node.js version from 16 to 18 LTS to get new features. Runs npm run build on an existing Create React App 4 project \(which uses webpack 4\). Build fails immediately with 'error:0308010C:digital envelope routines::unsupported'. Stack trace points to webpack's internal createHash function. Developer assumes Node installation is corrupt, reinstalls Node—same error. Searches the specific OpenSSL error code, finds GitHub issues on the Node.js repository explaining the OpenSSL 3.0 breaking change in Node 17\+. Discovers two solutions: either downgrade Node \(not ideal\), set NODE\_OPTIONS=--openssl-legacy-provider \(quick fix\), or upgrade to webpack 5 / react-scripts 5 \(proper fix\). Exports the env var, build succeeds, notes to upgrade webpack later.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:37:57.551862+00:00— report_created — created