webpack: nodejs 17: digital envelope routines::unsupported

Bug report

What is the current behavior?

[webpack-cli] 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 (/opt/src/node_modules/webpack/lib/util/createHash.js:155:18)
    at BulkUpdateDecorator.digest (/opt/src/node_modules/webpack/lib/util/createHash.js:80:21)
    at /opt/src/node_modules/webpack/lib/DefinePlugin.js:595:38
    at Hook.eval [as call] (eval at create (/opt/src/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
    at Hook.CALL_DELEGATE [as _call] (/opt/src/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/opt/src/node_modules/webpack/lib/Compiler.js:1053:26)
    at /opt/src/node_modules/webpack/lib/Compiler.js:1097:29
    at Hook.eval [as callAsync] (eval at create (/opt/src/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Other relevant information: webpack version: 5.59.0 Node.js version: 17.0.0 Operating System: linux x64

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 409
  • Comments: 288 (40 by maintainers)

Commits related to this issue

Most upvoted comments

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

where should this be added?

To be honestly it is very strange from Node.js developers, no deprecation messages, they just remove it… and break a lot of packages

The same situation is also with webpack@4. I hope that it will be fixed in the legacy versions too since I’m blocked to use the actual webpack versions in legacy projects due to the requirement of the support of old NodeJS versions.

We will not update that in webpack 4.

hmm… We can’t really automatically fallback to a different hashing algorithm, since this would break the determinism of builds (builds should be equal independent of node.js version).

We are planning to migrate to a different hash function anyway for webpack 6. So currently you will have to use output.hashFunction: "xxhash64" in configuration to fix that. Or --openssl-legacy-provider

Seems like the need to release a new major becomes more pressing…

To be honestly it is very strange from Node.js developers, no deprecation messages, they just remove it… and break a lot of packages

node.js 17 uses OpenSSL3 which have changed code for initialization context of md family (including md4): https://wiki.openssl.org/index.php/OpenSSL_3.0#Upgrading_to_OpenSSL_3.0_from_OpenSSL_1.0.2

But I agree that node.js could have warned you in advance, given that you are one of the biggest consumers.

I have replaced in package.json of the project:

"start": "react-scripts start"
"build": "react-scripts build"

with:

"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",

It worked

For webpack 4 solutions:

  • export NODE_OPTIONS=--openssl-legacy-provider
  • monkey patching crypto for md4 and Node.js v17

@FSM1 : if you use bash or related just execute that before you work with webpack.

Why do you ignore reproducible repo? What is output.hashFunction/output.hashDigest and etc? I see…

@csvan I think it affects mostly people using docker and using the node image without any tag (latest by default). The fix is simple, just use node:lts instead

this error can be solved by using stable version of nodejs

Windows:

  "scripts": {
    "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "lint": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
  },

The same situation is also with webpack@4. I hope that it will be fixed in the legacy versions too since I’m blocked to use the actual webpack versions in legacy projects due to the requirement of the support of old NodeJS versions.

I don’t like that this issue is closed with a workaround. As more systems move over to OpenSSL 3 only (such is the case here on Fedora 36), more people will experience this issue.

Libraries like Nuxt 2 still only support Webpack 4, and with Nuxt 3 still in beta, it’ll be a while before everyone migrates their projects over to Nuxt 3, and you can’t simply cram Webpack 5 into Nuxt 2 as it’s too tightly integrated.

IMO Webpack 4 should be retroactively fixed to use MD5 hashing, even if there’s no security issue with using MD4 in its context. MD4 has been known to be broken since around '95, the Node team was right to deprecate it, and now it won’t work even on a compatible Node version on systems that are too new. I think being able to work at all is more important than not breaking the determinism of builds.

In this case, the only option seems to be to downgrade openssl on your system (if it is even possible) or upgrade webpack.

Neither of those solutions are possible here. Downgrading OpenSSL breaks Fedora 36, and Nuxt 2 can’t be upgraded to use Webpack 5.

https://www.mail-archive.com/devel@lists.fedoraproject.org/msg171436.html

Thank you for this solution! I got it to work with create-react-app by using the following:

package.json:

  "scripts": {
    "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
    "build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
  },

For example, I was running into this issue when running gatsby build, so adding this to my NPM build script fixed the issue:

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

For example, I was running into this issue when running gatsby build, so adding this to my NPM build script fixed the issue:

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

That’s maybe gonna work on Linux base OS. for Windows OS you need add

{ "scripts": { "build": "set NODE_OPTIONS=--openssl-legacy-provider & gatsby build" } }

one of the most disgusting bug

God help anyone who’s read this far, but output.hashFunction: "xxhash64" wasn’t working for me either.

Ends up, I was using babel-loader: 8.2.2 which emits the same error (even has webpack in the stack trace). This is because it used md4 which is no longer available in node 18. Solved it by upgrading to babel-loader: 8.3.0.

imo node could do a lot better with their error message… at least list what type was requested and when it was deprecated.

Please, solution is above, just use it

export NODE_OPTIONS=–openssl-legacy-provider

is a workaround and not a solution

if you are using docker, you can switch from node:latest to node:lts as a workaround until we get the new webpack version with the fix

Thank you for this solution! I got it to work with create-react-app by using the following:

package.json:

  "scripts": {
    "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
    "build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
  },

This one also works

SOLUTION for React, Vue, Nuxt and Next

Use Node version lower than 17.0.0. And wait for the fix.


Also got this error (I got the "Error: error:0308010C:digital envelope routines::unsupported") after just creating a new project with React or Vue:

Node.js v17.0.1 NPM v8.1.0 Windows 10 Latest

I just got this error from my other projects too after updating Node to 17.0.1 and NPM to 8.10. Probably has something to do with Node version.

REPRODUCTION

  1. Use Node.js version 17.0.1 (can change with nvm)
  2. npx create-react-app my-app or vue create hello-world
  3. npm start(react) or npm run serve(vue)
  4. get the error _digital envelope routines::unsupported

Also happens in Nuxt.js.

Full 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 module.exports (C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\node_modules\webpack\lib\NormalModule.js:417:16)
    at C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\node_modules\webpack\lib\NormalModule.js:452:10
    at C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\node_modules\webpack\lib\NormalModule.js:323:13
    at C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\myUserName\Desktop\CODES\REACT\PROJECTS\test-react-app-of-mine\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

This work for me :

    For React, use the below in the package.json file.

“scripts”: { “start”: “react-scripts --openssl-legacy-provider start”, “build”: “react-scripts --openssl-legacy-provider build”, }

Yes indeed, CRA is actually the source of my problem, but I did find this solution:

Just change the npm start script in package.json from:

"start": "react-scripts start"

to:

"start": "react-scripts --openssl-legacy-provider start"

this has been fixed with release v5.61.0.

@romellem that would not work… if you want to have this as a part of your npm script you need:

env NODE_OPTIONS=--openssl-legacy-provider gatsby build
"scripts": {
    "start": "react-scripts --openssl-legacy-provider start",
  },

This is the workaround, i found. Just add “–openssl-legacy-provider” in the package.json under scripts.

Got this issue today, not sure what to do ?

With respect, you could at least try looking if people have not posted at least 20 workarounds in the 600+ comments before yours.

export NODE_OPTIONS=--openssl-legacy-provider

Where does this go?

Edit. Successful example discovered with Nextjs in the Package.json file:

"scripts": {
    "dev": "export SET NODE_OPTIONS=--openssl-legacy-provider && next dev -p 3009",
    "build": "export SET NODE_OPTIONS=--openssl-legacy-provider && next build",
    "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && next start"
  },

If you’re coming from Docker, add ENV NODE_OPTIONS=--openssl-legacy-provider to Dockerfile

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

this does not work for me

cross-env is most used for this.

  1. install cross-env
npm install cross-env
  1. put it in the scripts in package.json
{
"scripts": {
  "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack ...."
}
}

works for all os! 🎉

WebStorm 2023.2.5 Node v20.10.0

Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:68:19) at Object.createHash (node:crypto:138:10) at module.exports (C:\projects\character-creator\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (C:\projects\character-creator\node_modules\webpack\lib\NormalModule.js:417:16) at C:\projects\character-creator\node_modules\webpack\lib\NormalModule.js:452:10 at C:\projects\character-creator\node_modules\webpack\lib\NormalModule.js:323:13 at C:\projects\character-creator\node_modules\loader-runner\lib\LoaderRunner.js:367:11 at C:\projects\character-creator\node_modules\loader-runner\lib\LoaderRunner.js:233:18 at context.callback (C:\projects\character-creator\node_modules\loader-runner\lib\LoaderRunner.js:111:13) at C:\projects\character-creator\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’

The correct solution is to upgrade to webpack 5 (along with compatible plugins and loaders). Trying to revert the OpenSSL config change is insecure.

On PowerShell

$env:NODE_OPTIONS = "--openssl-legacy-provider"

Worked with Node v18.7.0

Has anyone gotten any of this working on Fedora 36?

nope. even with node v16.14.1 and webpack 4.46

I have found that this error can happen for nodejs 16 if your system only has openssl 3.x installed. This is the case with centos stream 9.

If your system does not have openssl 1.1.x, the problem will happens with webpack less than 5.61.0.

Also, the workaround will not work either:

podman run -i -t --rm centos:stream9 /bin/bash
[root@3a5713dfcc27 /]# dnf install -y nodejs
CentOS Stream 9 - BaseOS                                                                                                                                                  6.3 MB/s | 5.3 MB     00:00    
CentOS Stream 9 - AppStream                                                                                                                                               5.1 MB/s |  11 MB     00:02    
CentOS Stream 9 - Extras packages                                                                                                                                         8.8 kB/s | 2.2 kB     00:00    
Dependencies resolved.
==========================================================================================================================================================================================================
 Package                                            Architecture                             Version                                                    Repository                                   Size
==========================================================================================================================================================================================================
Installing:
 nodejs                                             x86_64                                   1:16.10.0-1.el9                                            appstream                                   215 k
Installing dependencies:
 libbrotli                                          x86_64                                   1.0.9-6.el9                                                baseos                                      314 k
 libuv                                              x86_64                                   1:1.42.0-1.el9                                             appstream                                   150 k
 nodejs-libs                                        x86_64                                   1:16.10.0-1.el9                                            appstream                                    14 M
 openssl                                            x86_64                                   1:3.0.1-4.el9                                              baseos                                      1.2 M
Installing weak dependencies:
 nodejs-docs                                        noarch                                   1:16.10.0-1.el9                                            appstream                                   6.6 M
 nodejs-full-i18n                                   x86_64                                   1:16.10.0-1.el9                                            appstream                                   7.8 M
 npm                                                x86_64                                   1:7.24.0-1.16.10.0.1.el9                                   appstream                                   2.8 M

Transaction Summary
==========================================================================================================================================================================================================
Install  8 Packages

Total download size: 33 M
Installed size: 162 M
Downloading Packages:
(1/8): libbrotli-1.0.9-6.el9.x86_64.rpm                                                                                                                                   1.8 MB/s | 314 kB     00:00    
(2/8): openssl-3.0.1-4.el9.x86_64.rpm                                                                                                                                     3.8 MB/s | 1.2 MB     00:00    
(3/8): libuv-1.42.0-1.el9.x86_64.rpm                                                                                                                                      334 kB/s | 150 kB     00:00    
(4/8): nodejs-16.10.0-1.el9.x86_64.rpm                                                                                                                                    392 kB/s | 215 kB     00:00    
(5/8): nodejs-full-i18n-16.10.0-1.el9.x86_64.rpm                                                                                                                          4.6 MB/s | 7.8 MB     00:01    
(6/8): nodejs-docs-16.10.0-1.el9.noarch.rpm                                                                                                                               3.6 MB/s | 6.6 MB     00:01    
(7/8): npm-7.24.0-1.16.10.0.1.el9.x86_64.rpm                                                                                                                              5.6 MB/s | 2.8 MB     00:00    
(8/8): nodejs-libs-16.10.0-1.el9.x86_64.rpm                                                                                                                               4.3 MB/s |  14 MB     00:03    
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                     7.4 MB/s |  33 MB     00:04     
CentOS Stream 9 - BaseOS                                                                                                                                                  1.6 MB/s | 1.6 kB     00:00    
Importing GPG key 0x8483C65D:
 Userid     : "CentOS (CentOS Official Signing Key) <security@centos.org>"
 Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: npm-1:7.24.0-1.16.10.0.1.el9.x86_64                                                                                                                                              1/1 
  Preparing        :                                                                                                                                                                                  1/1 
  Installing       : libuv-1:1.42.0-1.el9.x86_64                                                                                                                                                      1/8 
  Installing       : nodejs-docs-1:16.10.0-1.el9.noarch                                                                                                                                               2/8 
  Installing       : openssl-1:3.0.1-4.el9.x86_64                                                                                                                                                     3/8 
  Installing       : libbrotli-1.0.9-6.el9.x86_64                                                                                                                                                     4/8 
  Installing       : nodejs-libs-1:16.10.0-1.el9.x86_64                                                                                                                                               5/8 
  Installing       : nodejs-full-i18n-1:16.10.0-1.el9.x86_64                                                                                                                                          6/8 
  Installing       : npm-1:7.24.0-1.16.10.0.1.el9.x86_64                                                                                                                                              7/8 
  Installing       : nodejs-1:16.10.0-1.el9.x86_64                                                                                                                                                    8/8 
  Running scriptlet: nodejs-1:16.10.0-1.el9.x86_64                                                                                                                                                    8/8 
  Verifying        : libbrotli-1.0.9-6.el9.x86_64                                                                                                                                                     1/8 
  Verifying        : openssl-1:3.0.1-4.el9.x86_64                                                                                                                                                     2/8 
  Verifying        : libuv-1:1.42.0-1.el9.x86_64                                                                                                                                                      3/8 
  Verifying        : nodejs-1:16.10.0-1.el9.x86_64                                                                                                                                                    4/8 
  Verifying        : nodejs-docs-1:16.10.0-1.el9.noarch                                                                                                                                               5/8 
  Verifying        : nodejs-full-i18n-1:16.10.0-1.el9.x86_64                                                                                                                                          6/8 
  Verifying        : nodejs-libs-1:16.10.0-1.el9.x86_64                                                                                                                                               7/8 
  Verifying        : npm-1:7.24.0-1.16.10.0.1.el9.x86_64                                                                                                                                              8/8 

Installed:
  libbrotli-1.0.9-6.el9.x86_64            libuv-1:1.42.0-1.el9.x86_64              nodejs-1:16.10.0-1.el9.x86_64      nodejs-docs-1:16.10.0-1.el9.noarch      nodejs-full-i18n-1:16.10.0-1.el9.x86_64     
  nodejs-libs-1:16.10.0-1.el9.x86_64      npm-1:7.24.0-1.16.10.0.1.el9.x86_64      openssl-1:3.0.1-4.el9.x86_64      

Complete!
[root@3a5713dfcc27 /]# node --version
v16.10.0
[root@3a5713dfcc27 /]# export SET NODE_OPTIONS=--openssl-legacy-provider
[root@3a5713dfcc27 /]# node --version
node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
[root@3a5713dfcc27 /]# 
exit

In this case, the only option seems to be to downgrade openssl on your system (if it is even possible) or upgrade webpack.

@Vinchenzo98 if you are using Unix, you can run the cmd in your shell prompt or you can add it to your .bashrc so it is loaded everytime you open a shell.

If you are using windows, use @vaelsy’s method and edit your package.json to set the environment variable before running your start command. It will not look exactly like this but you should get the idea (I feel like the & should be &&, but I’m not sure):

in package.json
"serve": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve", "build": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build",

The latest webpack 5 version does no longer use the native md4 from crypto but a wasm implementation instead.

The same is true for the latest loader-utils version.

We do not plan to backport that to webpack 4. Please upgrade to webpack 5 instead (or don’t upgrade node.js).

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

If your using Docker for your build process insert this environment variable and it will work.

ENV NODE_OPTIONS=--openssl-legacy-provider

Did you read posts above? Ppls were posted solution 10 times. You need to run nodejs with --legacy-ssl option or configure your webpack to use xxhash.

On 24.10.2021 15:14, Nirban Chakraborty wrote:

I am a beginner and trying to create my first react app but after running npm start it is giving this error. `` How can I solve this problem and continue creating my first app? I am a beginner so please give me the code that I need to run I am currently running it on Linux Ubuntu 20.04 of Debian distribution

`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/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:471:10) at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:503:5 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:358:12 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at iterateNormalLoaders (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:221:10) /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/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/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:417:16) at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:452:10 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:323:13 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/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`

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/webpack/webpack/issues/14532#issuecomment-950314047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2MSBVOWNKK74H6ULZXXLUIP2CZANCNFSM5GJ2ATDQ.

Updating webpack to: "webpack": "^5.64.4", worked for me

Disclaimer

My team was unable to utilize the --openssl-legacy-provider NODE_OPTIONS flag so we did an analysis and ended up solving the issue via another method. This solution requires that your project’s webpack be able to be updated to a newer version.

Analysis:

This issue is being caused by webpack using OpenSSL2 to generate hashes. Node no longer supports the algorithm that was utilized. In order to get around this issue we need to update the webpack dependency to be version >=5.54.0. We can view which dependencies utilize webpack by typing npm ls webpack in our command line with or working directory set to the projects root folder. Since webpack is typically installed as a sub-dependency with other packages we cannot directly update it through the npm cli.

Solution:

  1. Delete Node_Modules to get a clean project.

  2. NPM >= 8.3.0 supports override statements in the package.json. In order to get around webpack causing this issue you can put the following in the bottom of your projects package.json file.

"overrides": {
  "webpack": "^5.54.0"
}
  1. Run npm install

  2. Test your project

Additional Points:

If you are still having issues this could be caused by another packing conflicting with the updated webpack. One such instance is older versions of postcss. Webpack requires there to be an export to the ./package.json of the node module. If we go into node_modules, and go to the ./package.json, we can add this line under exports:

“./package.json”: “./package.json”

If we do the second method then we need to make sure this step is completed each time we run npm install.

We can also just upgrade postcss via the same method as above to a newer version and in we would not have to edit it’s ./package.json for each npm install. Again this may lead to other conflicts that need to be resolved via normal troubleshooting procedure.

itt: People are rightfully confused because webpack is often bundled as part of other frameworks, which don’t always provide a way to change the command line parameters.

I still think the onus is on Webpack to release a patch to discontinue the usage of MD4 reproducibility be damned, as it was already DEPRECATED by the time affected webpack versions were released.

Setting the hashFunction to md4 in our webpack config did not work in all cases with Node 18. Problem is that the hashFunction is hard-coded in many places in webpack. Monkey-patching crypto as described here helped. See: https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 and https://github.com/webpack/webpack/issues/13572

Try this one @Umm-e-Habiba set NODE_OPTIONS=--openssl-legacy-provider

we have idea how to fix it without breaking change for v5, we will reimplement md4 using wasm version, anyway I strong recommend to switch on xxhash64

Highlighting https://github.com/webpack/webpack/issues/14532#issuecomment-950161266 again since I initially missed it in the flood of comments. Webpack v5.61.0 has the fix for this bug. They’ve added a fallback for md4 hash function, which is removed in Node 18 unless you use the --openssl-legacy-provider flag.

However, it’s recommended that you still go ahead and change your output.hashFunction in the webpack config to xxhash64 anyway. It’s a lot faster and will become default in webpack v6.

If you do use the --openssl-legacy-provider flag as a workaround instead, be aware that it was only added to support weak or compromised algorithms. Although webpack is not using md4 for any cryptographic purpose, so using the flag only to fix the webpack issue is fine but try to avoid this flag if you’re using node’s crypto module anywhere in your application.

I am facing this out of nowhere in webpack v4.x.x. All was working fine for the past one year. Now suddenly we encountering this. Are there any proper solution for this?

Got this issue today, not sure what to do ?

With respect, you could at least try looking if people have not posted at least 20 workarounds in the 600+ comments before yours.

With respect, none of them worked for me. btw, I managed to fix it. For people who got the same issue building with Docker, check if you are using latest node version and fix it by using version 16.x.x or 17.x.x RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - RUN apt-get install -y nodejs

When you faced with this issue please check your webpack version firstly - run npm ls webpack.

If you have webpack v4, you can’t use node >= 17. If you have webpack v5 - please update deps (you can run npm update or rm -rf package-lock.json && npm install to force reinstall all deps).

If you still have a problem please provide screenshot with a stacktrace here

The error was fixed by downgrading NVM from 17 to 16. Thank you!

JD

Thank you @dannylee8 !

FYI For others - If you’re using Angular and/or building GitHub Actions, put this in your package command (or where ever you call ncc build)

image

export NODE_OPTIONS=--openssl-legacy-provider Works well, simply needs to be run on every new terminal launch.

As has been explained multiple times already, this is not only unnecessary but DANGEROUS, please do not suggest it since the issue has been successfully patched. Update your dependencies instead and make sure not to use incompatible plugins.

This is a terrible issue. I’m struggling and struggling with the build process. Calm down 👊

I am a beginner and trying to create my first react app but after running npm start it is giving this error. `` How can I solve this problem and continue creating my first app? I am a beginner so please give me the code that I need to run I am currently running it on Linux Ubuntu 20.04 of Debian distribution

`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/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:471:10) at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:503:5 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:358:12 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at iterateNormalLoaders (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:221:10) /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/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/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:417:16) at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:452:10 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/webpack/lib/NormalModule.js:323:13 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:367:11 at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:233:18 at context.callback (/home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/node_modules/loader-runner/lib/LoaderRunner.js:111:13) at /home/severus_snape/Documents/HTML, CSS & JAVASCRIPT/React/textutils/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`

For example, I was running into this issue when running gatsby build, so adding this to my NPM build script fixed the issue:

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

That’s maybe gonna work on Linux base OS. for Windows OS you need add

{ "scripts": { "build": "set NODE_OPTIONS=--openssl-legacy-provider & gatsby build" } }

This worked with angular too! Though when executing the commands manually using Windows PowerShell the only way it works is by entering those two commands simultaneously dividing them with the & sign, while in bash you can first throw the export command and then build and that works. Hopefully I made it clear

FYI, using this in my package.json I have added export NODE_OPTIONS=--openssl-legacy-provider && before my commands:

  "scripts": {
    "dev": "export NODE_OPTIONS=--openssl-legacy-provider && mix -- --env NODE_ENV=development",
    "watch": "export NODE_OPTIONS=--openssl-legacy-provider && mix watch -- --env NODE_ENV=development",
    "production": "export NODE_OPTIONS=--openssl-legacy-provider && mix --production -- --env NODE_ENV=production"
  },

Using Laravel Mix ^6 with webpack.

Run in your console

On Thu, Mar 16, 2023 at 2:50 PM XiaoLi @.***> wrote:

workaround:

export NODE_OPTIONS=–openssl-legacy-provider

where should this be added?

I’m using win10 termianl git bash, just enter export NODE_OPTIONS=–openssl-legacy-provider in bash terminal , then restart you server it works. https://stackoverflow.com/questions/72866798/node-openssl-legacy-provider-is-not-allowed-in-node-options

— Reply to this email directly, view it on GitHub https://github.com/webpack/webpack/issues/14532#issuecomment-1471467977, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMT3PJHCPP5XWPZI543Q4TW4LA4ZANCNFSM5GJ2ATDQ . You are receiving this because you were mentioned.Message ID: @.***>

– [image: created with MySignature.io] https://mysignature.io/?utm_source=logo

Piyush Dolar Software Engineer Mobile: +918200646667 GitHub: https://github.com/piyushdolar https://github.com/piyushdolar Skype: piyushdolar https://mysignature.io/redirect/skype:piyushdolar?chat [image: created with MySignature.io] https://www.facebook.com/piyushdolarofficial [image: created with MySignature.io] https://twitter.com/piyush_dolar https://mysignature.io/editor/?utm_source=freepixel

Upgrading to react-scripts v5 when using create-react-app worked for me.

I’m using Fedora 36 and node v16.15.0.

I can’t upgrade node or webpack for my project at this time. When I try to set --openssl-legacy-provider in NODE_OPTIONS I get: node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

This breaks vscodes code . from the terminal https://github.com/microsoft/vscode/issues/136599

@rezab777

what is the workaround for those who are pulling the latest node image (17) and don’t want to go the export NODE_OPTIONS=--openssl-legacy-provider way ?

I changed from node:alpine to node:lts-alpine in my docker file to use node 16.x while I make the necessary changes to update the dependencies for create react app.

还有其他方法吗?我也遇到同样的问题

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

In which file should I put this code?

hmm… We can’t really automatically fallback to a different hashing algorithm, since this would break the determinism of builds (builds should be equal independent of node.js version).

We are planning to migrate to a different hash function anyway for webpack 6. So currently you will have to use output.hashFunction: "xxhash64" in configuration to fix that. Or --openssl-legacy-provider

Seems like the need to release a new major becomes more pressing…

where to write this command?

Note that export NODE_OPTIONS=--openssl-legacy-provider; is not a good solution, since we will get following error when we roll back our Node.js to 16:

node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

Another workaround output.hashFunction: 'sha256' is also not a good solution since Webpack child compiler does not compact it, some plugins like html-webpack-plugin won’t work.

After i run this comand in my terminal export NODE_OPTIONS=--openssl-legacy-provider then i try to run npm run dev but i got this error node: --openssl-legacy-provider is not allowed in NODE_OPTIONS Someone got this error too or Im doing something wrong

After updating to the latest react-scripts I did not have to use the openssl-legacy-provided flag any longer.

What is the estimated release date for Webpack 6 which will have the new hash implementations? Seems like this issue is still very prevalent in the wild despite being marked as fixed. Ideally, workarounds should not be needed to use Webpack.

Я переустановил nodejs на 16.12.0 версию. Ошибки ушли.

Hi

Is this fix is working for windows 10 as well?

On Mon, 4 Jul 2022 at 03:37, s-usr @.***> wrote:

The fix noted by @alexander-akait https://github.com/alexander-akait / @ArnaudLier https://github.com/ArnaudLier works nicely on Fedrora 36 with node v16.14.0 / @.***

/opt/Signal-Desktop/node_modules/webpack/lib/util/createHash.js line 137: comment out or delete let crypto = undefined; because crypto is now defined in the fix as const

— Reply to this email directly, view it on GitHub https://github.com/webpack/webpack/issues/14532#issuecomment-1173180058, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYYUC6MADKDRNO5GYJRIX6DVSIFKVANCNFSM5GJ2ATDQ . You are receiving this because you commented.Message ID: @.***>

Thanks & Regards

[image: image.png]

Piyush Joshi

Managing Director

Business Consultant | TechnoAce India

https://calendly.com/piyush-17/30min 9680-450-598 | 9799-992-111 @.*** www.technoace.in Jaipur, Rajasthan, India, 302020 [image: facebook] https://www.facebook.com/piyushjoshi.pj/ [image: twitter] https://twitter.com/er_piyushjoshi [image: linkedin] https://www.linkedin.com/in/piyush-joshi-🇮🇳-4409a647/ [image: instagram] https://www.instagram.com/piyushjoshi.pj/

Has anyone gotten any of this working on Fedora 36?

nope. even with node v16.14.1 and webpack 4.46

Thanks for confirming!

Case in point that Webpack 4 needs to be retrofitted with OpenSSL 3 support, especially now that Fedora 36 has been released for a while.

The error was fixed by downgrading NVM from 17 to 16. Thank you!

JD

I went from 17 to 16.14.2 and the error continues. I’m in a laradock

For those of us using CRA that still uses Webpack 4 it is still needed indeed!

IMHO. That is CRA’s responsibility to fix. There are already workarounds to fix this issue on WebPack 4 (xxhash64) that CRA could use.

CRA v4.0.3 pins webpack to 4.44.2 exactly, so even if WebPack went to the trouble to backport work to WebPack 4 (just because CRA hasn’t updated to WebPack 5 despite having a whole year) you still wouldn’t get the fix and would still need CRA to update react-scripts in order to have the issue fixed.

Nothing properly worked for me - I downgraded the node version to 16.2.0 nvm install 16.2.0 && nvm use 16.2.0

How do you update a React app with the new webpack release? I’m using Next.js.

@donnovan-lyons

React currently breaks on Node 17 (specifically, build fails). I’ve made an pull request, hope it merges soon @facebook/create-react-app#11597

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

If your using Docker for your build process insert this environment variable and it will work.

ENV NODE_OPTIONS=--openssl-legacy-provider

Thank you!

Hooray!

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

where should this be added?

I faced this issue in docker build, i have added this line in docker RUN export NODE_OPTIONS=–openssl-legacy-provider && yarn build && yarn install --production --ignore-scripts --prefer-offline

Thank you for this solution! I got it to work with create-react-app by using the following: package.json:

  "scripts": {
    "start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
    "build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build"
  },

This one also works

That only works if everyone working on the project uses Node 17. Node 16 or lower will throw an error on the unknown --openssl-legacy-provider flag.

Also , before this I removed nodejs and npm and then reinstall it but not the latest then this command . sudo npm install -g n sudo n stable

this will give you v14 and that’s working fine!

Confirming my PR #14557 is aiming to solve your problem @zdm. Got the same error as you.

Worked on angular

export NODE_OPTIONS=--openssl-legacy-provider

For all who care, I migrated from React + CRA to a new version of React + NextJS. I’ve had none of these headaches since then.

In my case, I fixed this by updating react-scripts, which in turn updates webpack.

My package.json had dependency to

"react-scripts": "^4.0.3",

and that installed webpack@4.44.2, which is causing the problem.

First, as suggested in this thread, I tried to use

"overrides": {
  "webpack": "^5.54.0"
}

but this ended up with strong warning saying that webpack version is too new and mismatch, likely causing hard-to-debug issues.

So I reverted it and instead did

npm install react-scripts@latest

as npm ls webpack tells that react-scripts is the one installing webpack as a downstream dependency. In my case, this updates react-scripts in package.json to "react-scripts": "^5.0.1", and this version of react-scripts has dependency to "webpack": "^5.64.4",. As the result, now my environment has webpack@5.88.2 with no warnings.

for VUE JS on package.json

change "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build" }, to "scripts": { "serve": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve", "build": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build" },

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

where should this be added?

where exactly add this?

you put this in .bashrc so that whenever you start the shell this environment variable is set. or once you open the shell at the command prompt type this…

I appear to be seeing this issue while trying to do ‘yarn start’ on a CRA app.

I’m running Rocky Linux v8.8 on a robust AWS EC2 instance. I’m running node v19.8.1.

I’ve tried adding ‘NODE_OPTIONS=–openssl-legacy-provider’ to both ‘cross-env’ and to the user environment with no apparent difference.

Here is the result while ‘NODE_OPTIONS’ is defined:

[tms@hoyo gate_dashboard]$ printenv NODE_OPTIONS
--openssl-legacy-provider
[tms@hoyo gate_dashboard]$ yarn start
yarn run v1.22.19
$ cross-env PORT=5001 react-scripts start
The certificate "/etc/letsencrypt/live/hoyo.zeetix.com/fullchain.pem" is invalid.
error:03000096:digital envelope routines::operation not supported for this keytype
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I believe that the certs are fine, I have multiple applications running and using them on this system with no issues.

I support two other systems that are running older versions of node (v14.20.0 and v14.20.1), those systems run fine.

I invite guidance about how best to proceed. A work-around is fine – this is a show-stopper.

Another popular usage:

"scripts": {
  "build": "NODE_OPTIONS=\"--openssl-legacy-provider\" webpack --config ./webpack.config.js"
}

“start”: “react-scripts --openssl-legacy-provider start”, “build”: “react-scripts --openssl-legacy-provider build”,

It worked! Thank you!

Time to close comments on this issue? Same questions just keep being repeated and the workarounds have been posted 100x times

I have to agree. Update the README to contain steps to solve this issue, and lock this GH issue.

It’s been discussed to death.

Please search for your particular issue in this thread before posting!

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

For noobs like me, I just want to clarify that you can run this directly in terminal. You won’t see any output, but it will work. (I’m on Linux, Ubuntu, Jammy)

workaround:

export NODE_OPTIONS=--openssl-legacy-provider

where should this be added?

I’m using win10 termianl git bash, just enter export NODE_OPTIONS=–openssl-legacy-provider in bash terminal , then restart you server it works. https://stackoverflow.com/questions/72866798/node-openssl-legacy-provider-is-not-allowed-in-node-options

Same here. Upgrading to node v18 is causing this break. Updating to webpack v5 is quite a lot of work and adding the --openssl-legacy-provider everywhere seems quite hacky

After i run this comand in my terminal export NODE_OPTIONS=--openssl-legacy-provider then i try to run npm run dev but i got this error node: --openssl-legacy-provider is not allowed in NODE_OPTIONS Someone got this error too or Im doing something wrong

use nodejs v16.x.x

guys, to solve this issue, use v16.x.x Im using v16, and its fixed you can install nvm to control node version

  1. Install nvm-setup.exe
  2. open terminal and run nvm install v[version here]
  3. nvm use [version]

this works, thanks

my pleasure

guys, to solve this issue, use v16.x.x Im using v16, and its fixed you can install nvm to control node version

  1. Install nvm-setup.exe
  2. open terminal and run nvm install v[version here]
  3. nvm use [version]

this works, thanks

guys, to solve this issue, use v16.x.x Im using v16, and its fixed you can install nvm to control node version

  1. Install nvm-setup.exe
  2. open terminal and run nvm install v[version here]
  3. nvm use [version]

@ToanNguyen-SPCE run this cmd export NODE_OPTIONS=--openssl-legacy-provider

Has anyone gotten any of this working on Fedora 36?

No, It’s not working with me on Fedora but works perfectly on Windows…

I’m using Fedora 36 and node v16.15.0.

I can’t upgrade node or webpack for my project at this time. When I try to set --openssl-legacy-provider in NODE_OPTIONS I get: node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

I have used the following commands to switch to Node V18:

sudo dnf module enable nodejs:18

sudo dnf module switch-to nodejs:18

Then you won’t need to set the NODE_OPTIONS env var.

Maaan… C:\Users\Ryan\AppData\Local\Programs\Microsoft VS Code\Code.exe: --openssl-legacy-provider is not allowed in NODE_OPTIONS

What a mess. Easy to just open vs code from another terminal tab, but that’s so irritating lol. I have a tab for deployments and another for opening my coding editor strictly because of this.

@nagkumar “set NODE_OPTIONS=–openssl-legacy-provider” did not work for me, but the following did work… export NODE_OPTIONS=–openssl-legacy-provider

Is this a CRA issue or Node17 Issue, as I see the same error on the angular application when running on Node 17. The workaround that worked to me on windows machine is

set NODE_OPTIONS=--openssl-legacy-provider

For those of us using CRA that still uses Webpack 4 it is still needed indeed!

IMHO. That is CRA’s responsibility to fix. There are already workarounds to fix this issue on WebPack 4 (xxhash64) that CRA could use.

CRA v4.0.3 pins webpack to 4.44.2 exactly, so even if WebPack went to the trouble to backport work to WebPack 4 (just because CRA hasn’t updated to WebPack 5 despite having a whole year) you still wouldn’t get the fix and would still need CRA to update react-scripts in order to have the issue fixed.

I do totally agree with you. This is not responsability of webpack anymore indeed. I was just pointing out that, as today, with react-scripts 4.0.3 we still have to do the export NODE_OPTIONS=--openssl-legacy-provider “fix”.

you do NOT need the workaround since the issue is solved, use latest version of Webpack.

For those of us using CRA that still uses Webpack 4 it is still needed indeed!

If you are using webpack v5 just run npm update --dev and try again, webpack v4 is not supported

Do I have to be on Nodev17?

I just ran this command on my project whilst still on V16 and I am still getting the same error message.

what is the workaround for those who are pulling the latest node image (17) and don’t want to go the export NODE_OPTIONS=--openssl-legacy-provider way ?

@kuriel-trivu Actually, you can use till node 16. I recommend you to use latest LTS version. Check the options that you can get the latest lts version.

v14 works 😉 since our private project was created. That’s ok for me. 😉 but thanks.

This error broke our CI/CD build setup.

we changed from

image: node:latest

to

image: node:14

Basically we rolled back from node 17 to 14 to make it work. 😦

file-loader is deprecated for webpack v5 (https://webpack.js.org/guides/asset-modules/), anyway it should work, try to update file-loader (i.e. you need update transitive loader-utils dep, you can run npm update --dev) to the latest version and run npm ls loader-utils

@stefcameron please provide stacktrace, also run npm ls webpack

You are right, thanks for pointing that out!

nextjs has updated webpack dependency with v12.0.2. just update.

If you use webpack@5, just update webpack, you don’t need workaround anymore

@slorber wasm version for v2 loader-utils https://github.com/webpack/loader-utils/releases/tag/v2.0.1, i.e. file-loader (https://github.com/webpack-contrib/file-loader/blob/master/package.json#L44) and other loaders which use old version of loader-utils@2 will work

loader-utils v1 will not get update, time to update your code and deps

Ping there once the next version is published 🙏


@olane moving to asset modules wasn’t so easy for me (https://github.com/facebook/docusaurus/pull/4708), will invest more time on this later.

And there’s something else using the missing hash algo in Webpack (can’t find exactly what but looks related to something using DefinePlugin), so fixing file-loader won’t solve it for me anyway.

@slorber It is breaking change, and we will need do major release of url-loader, and this will force other breaking changes, I will do compatibility patch release for v2 when we finish it here, but with limitations for very old Node.js versions (we can’t fix it for v4, v6, v8)

Serious question - do people have a hard requirement to use Node 17 or why is there so much panic

We don’t have a hard requirement, but if possible I’d like to make our local build and run process as foolproof as possible - if I can not worry if a developer has installed latest or LTS Node when setting up their machine then I’m going to have less questions to answer 😃

The output.hashFunction fix doesn’t work for me - more specifically, it solves one error but there seem to be more instances of the same error with file-loader. I’m looking at replacing that since it’s deprecated but the env var fix does seem to work - although it requires cross-env to make it work across platforms.

Serious question - do people have a hard requirement to use Node 17 or why is there so much panic? What feature of Node 17 (which came out just recently) is so crucial that you cannot run Node 16 (current LTS) in your CI systems or locally?

Please, solution is above, just use it

Yes you are right i was also stuck on 17 version but I when I tried sudo n stable my error resolved with 14 version.

That’s just because n aliases stable to lts. Node has no “stable”, they have “current” and “lts” (which can be active or maintenance). Both of which are stable.

Edit: The current Node.js is v16 and v17. The maintenance lts is v14. Tomorrow v16 is going to stop being current and become the active lts.

@csvan core-js-builder@3 should support NodeJS 8 for the compatibility reason and I’m not sure that core-js@4 ecosystem will be released this year. Since core-js-builder@3 is the actual version, it should support NodeJS 17 too. Anyway, changing md4 to something else is not a breaking change in this case.

@alexander-akait Repo ot reproduce warnings. when xxhash is used. https://github.com/zdm/webpack-issue-14532

npm i
npm run build
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: error:0308010C:digital envelope routines::unsupported
<w> while serializing webpack/lib/util/registerExternalSerializer.webpack-sources/ConcatSource -> Array { 12 items } -> webpack/lib/util/registerExternalSerializer.webpack-sources/RawSource -> Buffer

I recommend install nvm and install v14.15.0 (using nvm you can change node version and solve this problems)

@onurusluca Do you mean nodejs 17: digital envelope routines::unsupported or Skipped not serializable cache item? If first just use NODE_OPTIONS=--openssl-legacy-provider, anyway we have idea how to fix it without breaking change for v5, we will reimplement md4 using wasm version, anyway I strong recommend to switch on xxhash64

Yes, will do

On 23.10.2021 16:50, Alexander Akait wrote:

@zdm https://github.com/zdm Can you provide reproducible example? Maybe we have bug…

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/webpack/webpack/issues/14532#issuecomment-950155662, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH2MSBTP7HFGXOJ34CMOLLUIK4QTANCNFSM5GJ2ATDQ.

@xdadev37 env prefix (see example above) should work cross platform.