rustwasm / rust-webpack-template

Kickstart your Rust, WebAssembly, and Webpack project!
Apache License 2.0
562 stars 75 forks source link

Webpack dev-server fails to run with node 17.0.1+ #179

Open felixfaire opened 2 years ago

felixfaire commented 2 years ago

This is a webpack 4 bug that is described here (second answer seems the most relevant). This issue is supposedly resolved in webpack 5.61.0+.

Steps to Reproduce

  1. Run the template (npm run start) with node 17.0.1 or higher installed

Expected Behavior

Template runs devserver without issue

Actual Behavior

This error causes the dev server to fail:

Error: digital envelope routines::unsupported

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'

It appears this could be fixed by updating webpack to 5.61.0 or by enabling the --openssl-legacy-provider argument. Or at least making a note in the readme that the template will not work on node versions higher that 17.0.1.