Skip to content
nkNilay Kabariya

Entry No.004·Fixes··1 min read

Fix: ERR_OSSL_EVP_UNSUPPORTED digital envelope routines (webpack 4)

Old webpack 4 builds crash on Node 17+ with 0308010C. Upgrading webpack 4 to 4.47.0 fixes it without the legacy OpenSSL flag. Reproduced on Node 24.

by Nilay#webpack#node#opensslFIXED

The error, verbatim

Jump to the fix ↓
Error: error:0308010C:digital envelope routines::unsupported
  opensslErrorStack: [
    'error:03000086:digital envelope routines::initialization error',
    'error:0308010C:digital envelope routines::unsupported'
  ],
  library: 'digital envelope routines',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

Tested on

Node
24.14.0
Broken
webpack 4.46.0 + webpack-cli 3
Fixed
webpack 4.47.0
OS
Windows 11 Pro
Contents
  1. The fix01
  2. Why it happens02
  3. What didn’t work03

The fix

Best quick fix: upgrade webpack 4 to 4.47.0

You don’t have to jump to webpack 5. The last webpack 4 release handles this itself:

npm install -D webpack@4.47.0

If webpack comes from a tool you don’t control (an old react-scripts, vue-cli or similar), check which webpack it installed with npm ls webpack. Pinning 4.47.0 with overrides in package.json may work there too. I didn’t test those tools for this post.

Fallback: the legacy OpenSSL provider

# macOS / Linux
NODE_OPTIONS=--openssl-legacy-provider npm run build
# Windows PowerShell
$env:NODE_OPTIONS = "--openssl-legacy-provider"; npm run build

It works, but it re-enables old, weaker algorithms for the whole Node process. Treat it as a stopgap, not the fix.

Long term

Move to webpack 5 or a current build tool. Webpack 4 no longer gets updates, and 4.47.0 is its final release.

Why it happens

Webpack 4 hashes files with the md4 algorithm through Node’s crypto. Node 17 switched to OpenSSL 3, which disables legacy algorithms like md4 by default. Asking for it fails with 0308010C: digital envelope routines::unsupported. Webpack 4.47.0 added its own md4 implementation, so it no longer asks OpenSSL for it.

What didn’t work

— N.K., end of entry No.004

Useful? Pass it on:Post on X

Related entries

  1. No.005

    Fix: ERR_REQUIRE_ESM require() of ES Module not supported

    Why require() of an ES module fails, why it mostly stopped failing on Node 22.12+, and the new errors you hit instead. All reproduced on Node 24.

    > Error [ERR_REQUIRE_ESM]: require() of ES Module ...\node_modules\chalk\source\index.js

    FIXED1 min
  2. No.003

    Fix: EADDRINUSE address already in use :::3000 on Windows

    Your Node dev server won't start because the port is taken. Find the process holding it, stop it, and restart. Every step reproduced on Windows 11.

    > node:events:486

    FIXED1 min
  3. No.002

    Fix: __dirname is not defined in ES module scope (Node 24)

    ES modules don't have __dirname or __filename. The one-line modern fix (import.meta.dirname) and the fallback for older Node, both run on Node 24.

    > console.log(path.join(__dirname, "data.json"));

    FIXED1 min

Post card · Newsletter

Get the next fix in your inbox.

One short email when a new entry is published. No spam, never shared, and you can leave any time.

— Nilay

or follow by RSS

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text