Skip to content

npm start fails with error:0308010C:digital envelope routines::unsupported #184

@DDR0

Description

@DDR0

After running npm init rust-webpack sand2, I get the following unexpected error when running npm start.

> [email protected] start
> rimraf dist pkg && webpack-dev-server --open -d

🧐  Checking for wasm-pack...

✅  wasm-pack is installed at /home/david/.cargo/bin/wasm-pack. 

ℹ️  Compiling your crate in development mode...

ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/david/Projects/sand2/dist
ℹ 「wdm」: wait until bundle finished: /
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
warning: Found `debug_assertions` in `target.'cfg(...)'.dependencies`. This value is not supported for selecting dependencies and will not work as expected. To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies
   Compiling proc-macro2 v1.0.40
   Compiling unicode-ident v1.0.1
   Compiling quote v1.0.20
   Compiling log v0.4.17
   Compiling wasm-bindgen-shared v0.2.81
   Compiling syn v1.0.98
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling bumpalo v3.10.0
   Compiling wasm-bindgen v0.2.81
   Compiling wasm-bindgen-backend v0.2.81
   Compiling wasm-bindgen-macro-support v0.2.81
   Compiling wasm-bindgen-macro v0.2.81
   Compiling js-sys v0.3.58
   Compiling console_error_panic_hook v0.1.7
   Compiling web-sys v0.3.58
   Compiling rust-webpack-template v0.1.0 (/home/david/Projects/sand2)
    Finished dev [unoptimized + debuginfo] target(s) in 12.90s
[INFO]: Installing wasm-bindgen...
[INFO]: Optional fields missing from Cargo.toml: 'repository', 'license'. These are not necessary, but recommended
[INFO]: :-) Done in 13.18s
[INFO]: :-) Your wasm pkg is ready to publish at /home/david/Projects/sand2/pkg.
✅  Your crate has been correctly compiled

node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/david/Projects/sand2/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/david/Projects/sand2/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/david/Projects/sand2/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/david/Projects/sand2/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/david/Projects/sand2/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/david/Projects/sand2/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/david/Projects/sand2/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/home/david/Projects/sand2/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/david/Projects/sand2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/david/Projects/sand2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /home/david/Projects/sand2/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions