decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

CI builds are failing due to ERR_OSSL_EVP_UNSUPPORTED.

Open adunkman opened this issue 3 years ago • 1 comments

Describe the bug There is an issue with hashing algorithms in Webpack 4 and Node versions 17 and above, due to Node’s migration to OpenSSL3. It’s documented at https://github.com/webpack/webpack/issues/14532 — and all recent builds on this repo are failing due to the issue.

Builds fail with:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/runner/work/netlify-cms/netlify-cms/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/runner/work/netlify-cms/netlify-cms/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/runner/work/netlify-cms/netlify-cms/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/runner/work/netlify-cms/netlify-cms/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/runner/work/netlify-cms/netlify-cms/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/runner/work/netlify-cms/netlify-cms/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/runner/work/netlify-cms/netlify-cms/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/runner/work/netlify-cms/netlify-cms/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/runner/work/netlify-cms/netlify-cms/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/home/runner/work/netlify-cms/netlify-cms/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/runner/work/netlify-cms/netlify-cms/node_modules/babel-loader/lib/index.js:59:71 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Example pull requests which have failed with this error:

  • https://github.com/netlify/netlify-cms/pull/6498
  • https://github.com/netlify/netlify-cms/pull/6496
  • https://github.com/netlify/netlify-cms/pull/6492

To Reproduce

  1. Make a change (the changeset is not relevant)
  2. Open a pull request
  3. Observe build failure

Applicable Versions:

  • webpack@4
  • nodejs@17 and above

adunkman avatar Jun 28 '22 14:06 adunkman

The issue above suggests the possible paths forward:

  1. Remain on webpack@4, but supply --openssl-legacy-provider to nodejs:

    export NODE_OPTIONS=--openssl-legacy-provider
    
  2. Upgrade to webpack@5.

adunkman avatar Jun 28 '22 14:06 adunkman

This is fixed

martinjagodic avatar Aug 25 '23 11:08 martinjagodic