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

React frontend server won't start with Node 17 #3524

Closed
ghost opened this issue Nov 6, 2021 · 8 comments
Closed

React frontend server won't start with Node 17 #3524

ghost opened this issue Nov 6, 2021 · 8 comments
Labels
bug Bug report

Comments

@ghost
Copy link

ghost commented Nov 6, 2021

Describe the bug
Frontend server crashes due to webpack issue in Node 17.

To Reproduce
Steps to reproduce the behavior:

  1. Install Node 17
  2. Run yarn install && yarn start
  3. See error -
Starting the development server...

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 (/home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/dreamer/git/datahub/datahub-web-react/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/dreamer/git/datahub/datahub-web-react/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
/home/dreamer/git/datahub/datahub-web-react/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

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 (/home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/NormalModule.js:417:16)
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/NormalModule.js:452:10
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/webpack/lib/NormalModule.js:323:13
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/dreamer/git/datahub/datahub-web-react/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/dreamer/git/datahub/datahub-web-react/node_modules/react-scripts/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.0.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior
React localhost server starts normally.

Desktop (please complete the following information):

  • OS: Win 10
  • Browser Chrome
  • Version [e.g. 22]

Additional context
md5 hash algo is not available on crypto due to OpenSSL update. Reverting to Node 16 (current LTS version) is a workaround.

Issue on webpack is here: webpack/webpack#14532 (closed)

@ghost ghost added the bug Bug report label Nov 6, 2021
@ghost ghost closed this as completed Nov 8, 2021
@maggiehays
Copy link
Collaborator

@dannylee8 Just want to confirm - was this resolved?

@ghost
Copy link
Author

ghost commented Nov 9, 2021

Hi @maggiehays, unfortunately still exists. The issue is: webpack/webpack#14532. However, PR for a doc update was accepted, so I closed the issue. wdyt?

@gabe-lyons
Copy link
Contributor

@dannylee8 hey- looks like the issue you linked on webpack was resolved a few days ago! Can you try again and see if everything is good?

@maggiehays
Copy link
Collaborator

Hey @dannylee8 - looks like this was addressed & merged! NervJS/taro#10605

Going to keep this issue closed here, but feel free to reopen if needed.

@ghost
Copy link
Author

ghost commented Nov 23, 2021

Hi @gabe-lyons @maggiehays,
unfortunately looks like its still there. to reproduce, download nvm use 17 then d/l a fresh datahub repo, ./gradlew build -x test then cd into the datahub-web-react folder. yarn install && yarn start - still failing on unsupported digital envelope routines.

There's a hack using a switch NODE_OPTIONS=--openssl-legacy-provider yarn start, or dropping back to Node 16.0.0 works for me.

@ghost
Copy link
Author

ghost commented Nov 26, 2021

Just an update. Its starting to look like the fix needs to happen in CRA, from the discussion in this issue: facebook/create-react-app#11562

Since Node 16 is LTS, its probably not an issue for datahub users and it looks like the bug is on the way to being rectified, I think this issue can stay closed. Thanks!

@ToanP
Copy link

ToanP commented Jan 6, 2023

I am trying to setup a local environment and facing an issue with "Datahub-web-react"

Issuing the comment " ./gradlew :datahub-frontend:dist --stacktrace" and there was a failure with yarnQuickbuild


 Node.js v18.13.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

> Task :datahub-web-react:yarnQuickBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':datahub-web-react:yarnQuickBuild'.
> Process 'command 'yarn'' finished with non-zero exit value 1

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

@aabharti-visa
Copy link
Contributor

I have the below node version
v16.16.0

I am too getting the same error as mentioned by @ToanP . Is there a fix for this?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

4 participants