Report #17452
[bug\_fix] Error: error:0308010C:digital envelope routines::unsupported or ERR\_OSSL\_EVP\_UNSUPPORTED
Set the environment variable \`NODE\_OPTIONS=--openssl-legacy-provider\` or upgrade to webpack 5 / Next.js 12\+. Root cause: Node.js 17\+ uses OpenSSL 3.0 with stricter security algorithms; webpack 4 and legacy crypto implementations use algorithms incompatible with OpenSSL 3.0 strict mode.
Journey Context:
Developer upgrades from Node 16 LTS to Node 18 LTS. An existing React project using webpack 4 \(via react-scripts 4\) fails to start with \`ERR\_OSSL\_EVP\_UNSUPPORTED\`. The error occurs during webpack's initialization when it tries to use \`crypto.createHash\`. The developer initially considers downgrading Node.js. Searching the error reveals it is a breaking change in Node 17\+ \(OpenSSL 3.0\). The immediate workaround is setting \`export NODE\_OPTIONS=--openssl-legacy-provider\` before running the build, which enables the legacy OpenSSL provider in Node 18. This is added to package.json scripts. The long-term fix is upgrading to webpack 5 \(react-scripts 5\) or Next.js 12\+, which properly support OpenSSL 3.0 without the flag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:22:53.055984+00:00— report_created — created