Deploy issue: Error: error:0308010C:digital envelope routines::unsupported
- Dominant language
- JavaScript
- Stars
- 642
- Forks
- 369
- PR merge metrics
- No merged PRs in 30d
Description
I followed the readme and used nvm to switch to node 12 (previously I tried with node 16 LTS, same issue)
Environment: Fedora Linux (Fedora 36).
```
nvm use
Found '/test-dapp/.nvmrc' with version
Now using node v12.22.12 (npm v6.14.16)
yarn setup
yarn run v1.22.17
$ yarn install && yarn allow-scripts
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
warning Ignored scripts due to flag.
$ /test-dapp/node_modules/.bin/allow-scripts
running lifecycle scripts for event "preinstall"
running lifecycle scripts for event "install"
- sha3
- secp256k1
- keccak
running lifecycle scripts for event "postinstall"
running lifecycle scripts for top level package
Done in 7.79s.
yarn
yarn install v1.22.17
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.62s.
yarn lint
yarn run v1.22.17
$ yarn lint:eslint && yarn lint:misc --check
$ eslint . --cache --ext js,ts
$ prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' --ignore-path .gitignore --check
Checking formatting...
All matched files use Prettier code style!
Done in 2.69s.
yarn deploy
yarn run v1.22.17
$ ./deploy.sh
$ yarn lint:eslint && yarn lint:misc --check
$ eslint . --cache --ext js,ts
$ prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' --ignore-path .gitignore --check
Checking formatting...
All matched files use Prettier code style!
$ webpack --mode production
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 module.exports (/test-dapp/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/test-dapp/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/test-dapp/node_modules/webpack/lib/NormalModule.js:471:10)
at /test-dapp/node_modules/webpack/lib/NormalModule.js:503:5
at /test-dapp/node_modules/webpack/lib/NormalModule.js:358:12
at /test-dapp/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/test-dapp/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array. (/test-dapp/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/test-dapp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /test-dapp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
at /test-dapp/node_modules/graceful-fs/graceful-fs.js:115:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: Failed to build
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
Same issue with yarn build & yarn start
The `Error: error:0308010C:digital envelope routines::unsupported` issue seems a "well known" issue, in fact I remember I had this issue in a couple of other repos too, and the solution was to use node LTS. Well now I'm using node LTS and the issue is there.
I tried also what people suggest if you google search how to fix this:
```
export NODE_OPTIONS=--openssl-legacy-provider
```
Then tried again:
```
yarn deploy
/usr/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
```
The option to use openssl legacy is not allowed.
Can you please suggest a fix or even better push a fix so that when users clone this repo on a fresh machine and follow the instructions in the `README` it works out of the box?
A plus would be to support also the actual LTS version v16.x since v12 is a bit oldish.
Thank you.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with README, deploy.sh, and the webpack build invoked by yarn deploy; reproduce the failure on Node 12 and Node 16 in the Fedora environment described. Trace the OpenSSL-related webpack error and update the documented setup or build configuration so a fresh checkout can deploy successfully, then verify yarn build and yarn start as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, webpack
- Domain
- build-system, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100