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

Fix crash on Node 17+, upgrade to react-scripts v5.0.1 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmorella-dev
Copy link

Running a local build with modern versions of Node causes the following crash, because react-scripts@3 relies on an SSL faeture which was disabled in Node 17 for security reasons.

This PR upgrades react-scripts to the latest version, which resolves the issue and allows a successful build.

Note that react-scripts is deprecated and still reports many vulnerabilities and deprecation warnings, which this commit does not fix.

See this StackOverflow thread for more info.

Failed build log

yarn run v1.22.19
$ dotenv -e .env concurrently "yarn start:client"
[0] $ yarn --cwd client/ start
[0] $ npm-run-all -p start:css start:js
[0] $ postcss src/index.css -o public/index.min.css -w
[0] $ react-scripts start
[0] Starting the development server...
[0] 
[0] Error: error:0308010C:digital envelope routines::unsupported
[0]     at new Hash (node:internal/crypto/hash:79:19)
[0]     at Object.createHash (node:crypto:139:10)
[0]     at module.exports (/Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/util/createHash.js:135:53)
[0]     at NormalModule._initBuildHash (/Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/NormalModule.js:417:16)
[0]     at handleParseError (/Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/NormalModule.js:471:10)
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/NormalModule.js:503:5
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/NormalModule.js:358:12
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
[0]     at iterateNormalLoaders (/Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
[0]     at iterateNormalLoaders (/Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:236:3
[0]     at runSyncOrAsync (/Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
[0]     at iterateNormalLoaders (/Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
[0]     at Array.<anonymous> (/Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
[0]     at Storage.finished (/Users/mmorella/Git/Other/bitprint/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/graceful-fs/graceful-fs.js:115:16
[0]     at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
[0] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[0] /Users/mmorella/Git/Other/bitprint/client/node_modules/react-scripts/scripts/start.js:19
[0]   throw err;
[0]   ^
[0] 
[0] Error: error:0308010C:digital envelope routines::unsupported
[0]     at new Hash (node:internal/crypto/hash:79:19)
[0]     at Object.createHash (node:crypto:139:10)
[0]     at module.exports (/Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/util/createHash.js:135:53)
[0]     at NormalModule._initBuildHash (/Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/NormalModule.js:417:16)
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/NormalModule.js:452:10
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/webpack/lib/NormalModule.js:323:13
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:367:11
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:233:18
[0]     at context.callback (/Users/mmorella/Git/Other/bitprint/client/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
[0]     at /Users/mmorella/Git/Other/bitprint/client/node_modules/react-scripts/node_modules/babel-loader/lib/index.js:55:103 {
[0]   opensslErrorStack: [
[0]     'error:03000086:digital envelope routines::initialization error',
[0]     'error:0308010C:digital envelope routines::unsupported'
[0]   ],
[0]   library: 'digital envelope routines',
[0]   reason: 'unsupported',
[0]   code: 'ERR_OSSL_EVP_UNSUPPORTED'
[0] }
[0] 
[0] Node.js v22.2.0
[0] error Command failed with exit code 1.
[0] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[0] ERROR: "start:js" exited with 1.
[0] error Command failed with exit code 1.
[0] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[0] error Command failed with exit code 1.
[0] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[0] yarn start:client exited with code 1
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

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

Successfully merging this pull request may close these issues.

1 participant