Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy issue: Error: error:0308010C:digital envelope routines::unsupported #183

Open
cryptotester opened this issue Jul 21, 2022 · 1 comment

Comments

@cryptotester
Copy link

cryptotester commented Jul 21, 2022

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 <v12>
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.<anonymous> (/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.

@mcmire
Copy link
Collaborator

mcmire commented Dec 14, 2022

Hi @cryptotester, sorry for the delay in responding to this. It looks like we can make a change to the Webpack config to fix this, but we would need to upgrade it to at least 5.54.0 first, which itself requires an upgrade to Node. I've added an issue to upgrade Node here: #200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants