krpeacock / auth-client-demo

Example demo of how to use https://www.npmjs.com/package/@dfinity/auth-client to make authenticated calls to an IC app
https://vasb2-4yaaa-aaaab-qadoa-cai.ic0.app/
74 stars 32 forks source link

Error: error:0308010C:digital envelope routines::unsupported — Failed to run scripts/build.: The custom tool failed. #8

Closed troublesprouter closed 1 year ago

troublesprouter commented 1 year ago

When running II_FETCH_ROOT_KEY=1 II_DUMMY_CAPTCHA=1 dfx deploy --no-wallet --argument '(null)' I'm getting:

black@MacBook-Pro internet-identity % II_FETCH_ROOT_KEY=1 II_DUMMY_CAPTCHA=1  dfx deploy --no-wallet --argument '(null)'

Deploying all canisters.
All canisters have already been created.
Building canisters...
Executing 'scripts/build'
Compiling internet_identity frontend assets

> @dfinity/internet-identity@0.1.0 build
> NODE_ENV=production npm run opts -- webpack --config-name app

> @dfinity/internet-identity@0.1.0 opts
> NODE_OPTIONS='--loader ts-node/esm --experimental-specifier-resolution=node' "$@" webpack --config-name app

(node:29961) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:29961) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
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 (/Users/black/icp/internet-identity/node_modules/webpack/lib/util/createHash.js:145:18)
    at BulkUpdateDecorator.update (/Users/black/icp/internet-identity/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/Users/black/icp/internet-identity/node_modules/webpack-sources/lib/RawSource.js:64:8)
    at NormalModule._initBuildHash (/Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:868:17)
    at handleParseResult (/Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:934:10)
    at /Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:1026:4
    at processResult (/Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:743:11)
    at /Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:807:5
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 (/Users/black/icp/internet-identity/node_modules/webpack/lib/util/createHash.js:145:18)
    at BulkUpdateDecorator.update (/Users/black/icp/internet-identity/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/Users/black/icp/internet-identity/node_modules/webpack-sources/lib/RawSource.js:64:8)
    at NormalModule._initBuildHash (/Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:868:17)
    at handleParseResult (/Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:934:10)
    at /Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:1026:4
    at processResult (/Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:743:11)
    at /Users/black/icp/internet-identity/node_modules/webpack/lib/NormalModule.js:807:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build call canisters.
    Failed while trying to build all canisters.
      The build step failed for canister 'renrk-eyaaa-aaaaa-aaada-cai' (internet_identity) with an embedded error: Failed to build custom canister internet_identity.: Failed to run scripts/build.: The custom tool failed.
troublesprouter commented 1 year ago

It seems to be a problem with Node 17.

This fixed it:

nvm install 16
nvm use 16

Ref: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported