Report #16324
[bug\_fix] error:0308010C:digital envelope routines::unsupported \(OpenSSL 3.0\)
Set environment variable NODE\_OPTIONS=--openssl-legacy-provider before running the build command, or upgrade to webpack 5\+ and update all loaders/plugins to versions supporting OpenSSL 3.0, or downgrade to Node.js 16 LTS which uses OpenSSL 1.1.1.
Journey Context:
You upgrade your machine to Node.js 18 LTS \(or a teammate does\), and suddenly your React app \(created with Create React App 4 or using webpack 4\) fails to build with a cryptic OpenSSL error from crypto.js. You search the error and find it started with Node 17 which bundled OpenSSL 3.0, which has stricter providers. You try reinstalling node\_modules, clearing npm cache, even reinstalling Node. The issue persists because webpack 4's crypto usage triggers legacy OpenSSL routines. You find the workaround: setting NODE\_OPTIONS=--openssl-legacy-provider in your package.json scripts or environment. This tells Node to enable the legacy OpenSSL provider, allowing the old crypto calls to work. The permanent fix is upgrading to webpack 5 which properly handles OpenSSL 3.0.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:22:26.551235+00:00— report_created — created