. Advertisement .
..3..
. Advertisement .
..4..
The error: “Error: error:0308010C:digital envelope routines::unsupported in reactjs” is a common problem that can show up in many ways. In this blog, we will go through some of the ways you can fix this issue. Read on.
What is the Error: “Error: error:0308010C:digital envelope routines::unsupported in reactjs”?
React considered as a JavaScript library for creating complex interactive User Interfaces from encapsulated components. IntelliJ IDEA integrates with React providing support such as configuring, editing, debugging, linting, running and maintaining the applications.
So, when creating the default IntelliJ IDEA React project and you will get the following warning message:
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
How To Solve This problem?
Approach 1: Modify your package.json
In your package.json, you must update the start script from
"start": "react-scripts start"
to
"start": "react-scripts --openssl-legacy-provider start"
Approach 2: Downgrade node version
This problem is present in Node version 17.0. However, downgrading the node version will fix the problem. Simply run the command listed below.
nvm install 16.13.0 #here put your required version
Approach 3: Utilize the following command
Simply type the following command into your terminal.
export NODE_OPTIONS=--openssl-legacy-provider
Approach 4: Modify the build script
In your package.json, you have to modify the build script to look like this.
{
"scripts": {
"build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build"
}
}
Approach 5: Simply utilize the following command
This is the official message:
If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option, --openssl-legacy-provider, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions.
Simply use the following command in your terminal:
node --openssl-legacy-provider ./node_modules/.bin/gatsby build
Your problem has now been resolved.
Conclusion
When you start an application in an debugging session in the beginning, it could occur that certain breakpoints that are executed upon loading the page aren’t reached. The reason for this is that in order to stop an breakpoint in the initial source code IntelliJ IDEA needs to get the source maps from the browser. But the browser can only provide these maps after the pages has loaded at least one time. For a temporary solution, try reloading the page within the browser you are using.
That is relevant knowledge that it is useful for you to learn about ntelliJ IDEA and we hope you enjoyed our article about the error. With this knowledge, we know that you can fix your issue: “Error: error:0308010C:digital envelope routines::unsupported in reactjs” quickly by following these steps!
If you still have any other questions about fixing this syntax error, please leave a comment below. Thank you for reading!
Leave a comment