healthyregions / oeps

Opioid Environment Policy Scan - data explorer and backend management
https://oeps.healthyregions.org
GNU General Public License v3.0
0 stars 0 forks source link

Fix build error related to OpenSSL and node version #21

Closed mradamcox closed 11 months ago

mradamcox commented 1 year ago

Running npm run build results in this error:

info  - Creating an optimized production build ...node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at BulkUpdateDecorator.hashFactory (..../oeps-explorer/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
    at BulkUpdateDecorator.update (..../oeps-explorer/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
    at .../oeps-explorer/node_modules/next/dist/compiled/webpack/bundle5.js:59321:9
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at process.processImmediate (node:internal/timers:442:9) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

@bucketteOfIvy has done some troubleshooting around this error already, here's what we need to look into: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

Best fix will be upgrading all necessary packages, if possible.

Close ticket when npm run build completes without error, and Node has been upgraded to at least 17.

mradamcox commented 1 year ago

Copy-pasted through some brute-force upgrade attempts yesterday just for fun. Not too much luck. I think a careful comparison of the underlying dependency versions for packages like react-* and deck-gl may be a good place to start next time around.