Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(ui): export 'NODE_OPTIONS=--openssl-legacy-provider' if node > 16
Updates UI build script to check the version of node available, parse the major version out, and then set the legacy openssl provider node option if the installed node version is above 16. Resolves several CI build issues with images that use node v20+. Example: https://github.com/prometheus/promlens/actions/runs/11749125293/job/32738433538?pr=149 ```bash Creating an optimized production build... Browserslist: caniuse-lite is outdated. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme /app/app/node_modules/react-scripts/scripts/build.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 (/app/app/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/app/app/node_modules/webpack/lib/NormalModule.js:417:16) at /app/app/node_modules/webpack/lib/NormalModule.js:452:10 at /app/app/node_modules/webpack/lib/NormalModule.js:323:13 at /app/app/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /app/app/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/app/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at /app/app/node_modules/babel-loader/lib/index.js:59:103 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v20.5.1 make: *** [Makefile:36: build-ui] Error 1 !! The base builder docker image exited unexpectedly: exit status 2 ``` Signed-off-by: TJ Hoplock <[email protected]>
- Loading branch information