0

OS : centos stream 9
Rust : 1.61
substrate : 2022-05 3.0
polkdadot : 0.9.20
substrate-front-end : 2022-02
nvm node nodejs : 16.14.0

success : Start the local Substrate node enter image description here

when i Start the front-end template yarn start , it show error

Failed to compile.

Error: error:0308010C:digital envelope routines::unsupported
    at Generator.next (<anonymous>)
    at new Promise (<anonymous>)
asset static/js/bundle.js 46.7 KiB [emitted] (name: main) 1 related asset
asset index.html 2.27 KiB [emitted]
asset asset-manifest.json 277 bytes [emitted]
cached modules 27.2 KiB [cached] 9 modules
modules with errors 156 bytes [errors]
  ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js 39 bytes [built] [1 error]
  ./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=8000&pathname=%2Fws&logging=none&reconnect=10 39 bytes [built] [1 error]
  ./node_modules/webpack/hot/dev-server.js 39 bytes [built] [1 error]
  ./src/index.js 39 bytes [built] [1 error]

ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at filename (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:102:23)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:128:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:194)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:97

ERROR in ./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=8000&pathname=%2Fws&logging=none&reconnect=10
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at filename (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:102:23)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:128:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:194)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:97

ERROR in ./node_modules/webpack/hot/dev-server.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at filename (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:102:23)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:128:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:194)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:97

ERROR in ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at filename (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:102:23)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:128:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:194)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /home/lzh/substrate-node-template/substrate-front-end-template/node_modules/babel-loader/lib/cache.js:5:97

webpack 5.70.0 compiled with 4 errors in 1753 ms

enter image description here

1 Answer 1

1

This is an issue with Node 17+ - see some other answers on SO with possible solutions.

You can tweak the Webpack config as well to only use xxhash, we actually did that in the apps UI to work around this issue.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .