Node.js "error:0308010C:digital envelope routines::unsupported" in CI
Node 17+ ships OpenSSL 3, which removed support for the legacy MD4-based hashing that older Webpack 4 / build tooling uses for chunk hashing. The build aborts with error:0308010C.
What this error means
After a Node upgrade, a build fails with error:0308010C:digital envelope routines::unsupported. The same code built fine on older Node with OpenSSL 1.x.
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
code: 'ERR_OSSL_EVP_UNSUPPORTED'Common causes
OpenSSL 3 dropped the legacy hash
OpenSSL 3 moved legacy algorithms into a separate provider. Tools that default to MD4 for hashing fail unless the legacy provider is enabled.
Old Webpack/build tooling
Webpack 4 and some older bundlers hash with an algorithm OpenSSL 3 no longer enables by default, so a Node upgrade breaks them.
How to fix it
Upgrade the build tooling
The durable fix is upgrading Webpack 5+ (or the affected tool), which uses an OpenSSL-3-compatible hash.
- Upgrade webpack and its loaders/plugins to v5+.
- Rebuild and confirm the hash error is gone.
- Remove any legacy-provider workaround afterward.
Enable the legacy provider as a stopgap
Set the OpenSSL legacy provider flag while you cannot upgrade the tool.
NODE_OPTIONS=--openssl-legacy-provider npm run buildHow to prevent it
- Keep build tooling current so it works with OpenSSL 3.
- Pin a Node version in CI and test upgrades before bumping.
- Treat the legacy-provider flag as temporary, not permanent config.