0

I am facing this error while deploying my react application frontend for my dapp made with truffle on vercel. What to do to fix it?

FYI: I am using node version 16.15.1 and react-scripts 3.2.0

[23:58:23.946] Previous build cache not available
[23:58:24.845] Cloning completed: 1.027s
[23:58:25.021] Running "vercel build"
[23:58:25.494] Vercel CLI 28.8.0
[23:58:25.508] WARN! Did you mean to deploy the subdirectory "build"? Use `vc --cwd build` instead.
[23:58:26.068] Installing dependencies...
[23:58:26.392] yarn install v1.22.17
[23:58:26.453] warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[23:58:26.455] [1/4] Resolving packages...
[23:58:26.870] warning react-scripts > [email protected]: "Please update to latest v2.3 or v2.2"
[23:58:26.871] warning react-scripts > webpack-dev-server > chokidar > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
[23:58:26.871] warning react-scripts > babel-jest > @jest/transform > jest-haste-map > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
[23:58:27.103] [2/4] Fetching packages...
[23:58:38.705] [3/4] Linking dependencies...
[23:58:38.709] warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[23:58:52.471] [4/4] Building fresh packages...
[23:58:53.173] success Saved lockfile.
[23:58:53.176] Done in 26.79s.
[23:58:53.211] Running "yarn run build"
[23:58:53.366] yarn run v1.22.17
[23:58:53.389] $ react-scripts build
[23:58:54.431] Creating an optimized production build...
[23:58:54.558] Error: error:0308010C:digital envelope routines::unsupported
[23:58:54.558]     at new Hash (node:internal/crypto/hash:71:19)
[23:58:54.558]     at Object.createHash (node:crypto:133:10)
[23:58:54.558]     at module.exports (/vercel/path0/node_modules/webpack/lib/util/createHash.js:135:53)
[23:58:54.559]     at NormalModule._initBuildHash (/vercel/path0/node_modules/webpack/lib/NormalModule.js:417:16)
[23:58:54.559]     at handleParseError (/vercel/path0/node_modules/webpack/lib/NormalModule.js:471:10)
[23:58:54.559]     at /vercel/path0/node_modules/webpack/lib/NormalModule.js:503:5
[23:58:54.559]     at /vercel/path0/node_modules/webpack/lib/NormalModule.js:358:12
[23:58:54.559]     at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:373:3
[23:58:54.559]     at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
[23:58:54.559]     at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:236:3
[23:58:54.559]     at runSyncOrAsync (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
[23:58:54.560]     at iterateNormalLoaders (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
[23:58:54.560]     at Array.<anonymous> (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
[23:58:54.560]     at Storage.finished (/vercel/path0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
[23:58:54.560]     at /vercel/path0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
[23:58:54.993] /vercel/path0/node_modules/react-scripts/scripts/build.js:19
[23:58:54.993]   throw err;
[23:58:54.993]   ^
[23:58:54.993] 
[23:58:54.993] Error: error:0308010C:digital envelope routines::unsupported
[23:58:54.994]     at new Hash (node:internal/crypto/hash:71:19)
[23:58:54.994]     at Object.createHash (node:crypto:133:10)
[23:58:54.994]     at module.exports (/vercel/path0/node_modules/webpack/lib/util/createHash.js:135:53)
[23:58:54.995]     at NormalModule._initBuildHash (/vercel/path0/node_modules/webpack/lib/NormalModule.js:417:16)
[23:58:54.995]     at /vercel/path0/node_modules/webpack/lib/NormalModule.js:452:10
[23:58:54.995]     at /vercel/path0/node_modules/webpack/lib/NormalModule.js:323:13
[23:58:54.995]     at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:367:11
[23:58:54.995]     at /vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:233:18
[23:58:54.995]     at context.callback (/vercel/path0/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
[23:58:54.996]     at /vercel/path0/node_modules/babel-loader/lib/index.js:55:103 {
[23:58:54.996]   opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
[23:58:54.997]   library: 'digital envelope routines',
[23:58:54.999]   reason: 'unsupported',
[23:58:54.999]   code: 'ERR_OSSL_EVP_UNSUPPORTED'
[23:58:54.999] }
[23:58:54.999] 
[23:58:54.999] Node.js v18.12.1
[23:58:55.025] error Command failed with exit code 1.
[23:58:55.026] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[23:58:55.041] Error: Command "yarn run build" exited with 1

1 Answer 1

1

Hope you've fixed this by now. Else,

In Vercel Environment Variables create new variable: Variable:NODE_OPTIONS Value:--openssl-legacy-provider

Works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.