Open DDR0 opened 2 years ago
Same here, tried on two systems.
Hey, I got rid of this error by downgrading my nodejs to v14.21.0 (nodejs-lts-fermium).
hi ! I met the same error following this tutorial : https://rustwasm.github.io/docs/book/game-of-life/hello-world.html
➜ www git:(master) ✗ npm start
> create-wasm-app@0.1.0 start
> webpack-dev-server
(node:72723) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:471:10)
at /mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:503:5
at /mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:358:12
at /mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array.<anonymous> (/mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
at /mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
at /mnt/a53f0ac3-5681-4d20-8292-8ff20b8d0d0b/Documents/project/rust/wasm/wasm-game-of-life/www/node_modules/graceful-fs/graceful-fs.js:78: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.12.1
I downgrade my nodejs to the LTS v16.18.1 (Gallium) to get rid of this error.
Add to webpack.config.js:
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
This should fix the error.
@pythagorean Thanks ! Can confirm it worked. I think this should be added to the wasm-book.
Is this an issue with the book, or is this something that should be changed in the template?
After running
npm init rust-webpack sand2
, I get the following unexpected error when runningnpm start
.