1

Getting the following error when I am trying to deploy an LWC OSS app to Heroku, I tried to deploy my app which had customizations got the same error, but now this is an LWC OSS fresh installation which I am trying to deploy. Still facing the issue.

Here is the Repo: https://github.com/somyatiwari59/SterlingCombine/tree/master

Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:130:10) at BulkUpdateDecorator.hashFactory (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/util/createHash.js:145:18) at BulkUpdateDecorator.update (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/util/createHash.js:46:50) at RawSource.updateHash (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack-sources/lib/RawSource.js:64:8) at NormalModule._initBuildHash (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:870:17) at handleParseResult (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:936:10) at /tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:1028:4 at processResult (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:745:11) at /tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:809:5 node:internal/crypto/hash:67 this[kHandle] = new _Hash(algorithm, xofLen); ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:130:10) at BulkUpdateDecorator.hashFactory (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/util/createHash.js:145:18) at BulkUpdateDecorator.update (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/util/createHash.js:46:50) at RawSource.updateHash (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack-sources/lib/RawSource.js:64:8) at NormalModule._initBuildHash (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:870:17) at handleParseResult (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:936:10) at /tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:1028:4 at processResult (/tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:745:11) at /tmp/build_5ccc2cd6/node_modules/lwc-services/node_modules/webpack/lib/NormalModule.js:809:5 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v17.2.0 -----> Build failed

 We're sorry this build is failing! You can troubleshoot common issues here: https://devcenter.heroku.com/articles/troubleshooting-node-deploys 

1 Answer 1

1

I have added --openssl-legacy-provider in front of the build, build-development, start:client, and start:api commands, and my scripts in package.json looks as below:

"scripts": { "build": "lwc-services --openssl-legacy-provider build -m production", "build:development": "lwc-services --openssl-legacy-provider build", "lint": "eslint ./src/**/*.js", "postinstall": "husky install", "precommit": "npm run prettier:verify && [ $? -eq 0 ] && npm run lint", "prettier": "prettier --write \"**/*.{css,html,js,json,md,ts,yaml,yml}\"", "prettier:verify": "prettier --list-different \"**/*.{css,html,js,json,md,ts,yaml,yml}\"", "start": "node --openssl-legacy-provider scripts/server.js", "start:api": "node --openssl-legacy-provider src/server/api.js", "start:client": "node --openssl-legacy-provider scripts/server.js", "test:unit": "lwc-services test:unit", "test:unit:coverage": "lwc-services test:unit --coverage", "test:unit:debug": "lwc-services test:unit --debug", "test:unit:watch": "lwc-services test:unit --watch", "watch": "run-p watch:client watch:server", "watch:client": "lwc-services watch", "watch:server": "nodemon" } 
2
  • 1
    The other option you can use is to change package.json "engines": { "node": ">=10.13.0" ... to "engines": { "node": "14.x" ... }, at least until they fix the SSL problem. Commented Dec 12, 2021 at 6:19
  • 1
    --openssl-legacy-provider is not best solution because it's running with known insecure SSL openssl.org/docs/manmaster/man7/OSSL_PROVIDER-legacy.html. as @sfdxfox said change engine to 14.x . heroku also recommends devcenter.heroku.com/articles/… Commented Dec 15, 2021 at 22:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.