Monday, November 1, 2021

Error: error:0308010C:digital envelope routines::unsupported in webpack

Hello Guys, How are you all? Hope You all Are Fine. Today I am using webpack But I am facing following error Error: error:0308010C:digital envelope routines::unsupported in webpack. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How This Error Occurs ?

I am using webpack But I am facing following error.

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at BulkUpdateDecorator.hashFactory (/app/node_modules/webpack/lib/util/createHash.js:155:18)
at BulkUpdateDecorator.update (/app/node_modules/webpack/lib/util/createHash.js:46:50)
at OriginalSource.updateHash (/app/node_modules/webpack-sources/lib/OriginalSource.js:131:8)
at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:888:17) at handleParseResult (/app/node_modules/webpack/lib/NormalModule.js:954:10)
at /app/node_modules/webpack/lib/NormalModule.js:1048:4
at processResult (/app/node_modules/webpack/lib/NormalModule.js:763:11)
at /app/node_modules/webpack/lib/NormalModule.js:827:5 {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’, code: ‘ERR_OSSL_EVP_UNSUPPORTED’
}
command terminated with exit code 1

How To Solve Error: error:0308010C:digital envelope routines::unsupported in webpack Error ?

  1. How To Solve Error: error:0308010C:digital envelope routines::unsupported in webpack Error ?

    To Solve Error: error:0308010C:digital envelope routines::unsupported in webpack Error You just need to modify the webpack.config.cjs just update output key to include the hashFunction just like this: hashFunction: “xxhash64” Second solution is Just run this command in Your terminal: node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved.

  2. Error: error:0308010C:digital envelope routines::unsupported in webpack

    To Solve Error: error:0308010C:digital envelope routines::unsupported in webpack Error You just need to modify the webpack.config.cjs just update output key to include the hashFunction just like this: hashFunction: “xxhash64” Second solution is Just run this command in Your terminal: node –openssl-legacy-provider ./node_modules/.bin/gatsby build Now your error must be solved.

Solution 1: modify the webpack.config.cjs

You just need to modify the webpack.config.cjs just update output key to include the hashFunction just like this.

module.exports = {
    output: {
        hashFunction: "xxhash64"
    }
};

Now, Your error must be solved.

Solution 2: Just use this command

Here is 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.

Just run this command in Your terminal.

node --openssl-legacy-provider ./node_modules/.bin/gatsby build

Now your error must be solved.

Solution 3: change the build script

You should change the build script something like this in your package.json.

{
"scripts": {
"build": "export NODE_OPTIONS=--openssl-legacy-provider; gatsby build"
}
}

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

1 comment:

  1. Thank you.

    P.S. Your blog post is mentioned as a reference in a comment on a Storybook.js issue:

    https://github.com/storybookjs/storybook/issues/16555#issuecomment-975690756

    ReplyDelete

No String Argument Constructor/Factory Method to Deserialize From String Value

  In this short article, we will cover in-depth the   JsonMappingException: no String-argument constructor/factory method to deserialize fro...