dSynMa/recipe

Web UI needs SSL legacy provider with new nodeJS

lou1306 opened this issue · 0 comments

I recently updated node to v20.5.1. Running npm start from directory frontend-react gives the following error:

Starting the development server...

/Users/lucad/git/recipe/frontend-react/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/Users/lucad/git/recipe/frontend-react/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/lucad/git/recipe/frontend-react/node_modules/webpack/lib/NormalModule.js:417:16)
    at /Users/lucad/git/recipe/frontend-react/node_modules/webpack/lib/NormalModule.js:452:10
    at /Users/lucad/git/recipe/frontend-react/node_modules/webpack/lib/NormalModule.js:323:13
    at /Users/lucad/git/recipe/frontend-react/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /Users/lucad/git/recipe/frontend-react/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/Users/lucad/git/recipe/frontend-react/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /Users/lucad/git/recipe/frontend-react/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v20.5.1

It seems that node recently changed the way it handles SSL, causing the error. The easiest workaround is to create a file named .npmrc under react-frontend with this line in it:

node-options="--openssl-legacy-provider"

With this, the Web UI starts correctly.

Long-term, we should probably upgrade react to a more recent version supporting the new SSL provider.