PacktPublishing / Game-Development-with-Rust-and-WebAssembly

Game Development with Rust and WebAssembly, Published by Packt
MIT License
205 stars 33 forks source link

Crypto issue when following the hello world set up? #18

Closed rgates-fieldwire closed 1 year ago

rgates-fieldwire commented 1 year ago

got to page 8 in the book and tried to run "npm run start" but got the follow issues:

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 (/Users//Tests/WebAssembly/walk-the-dog/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/Users//Tests/WebAssembly/walk-the-dog/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/Users/*/Tests/WebAssembly/walk-the-dog/node_modules/webpack/lib/NormalModule.js:471:10)

Seems to have something todo with the crypto set up the template.

Did some googling found this solution: export NODE_OPTIONS=--openssl-legacy-provider

Allows me to carry on my learning but that is not a great solution in the long run.

Any input on what the issue is?

paytonrules commented 1 year ago

Unfortunately that's probably the version of OpenSSL on your machine - I'll have to look into it further to be sure. Mostly likely I'll have to add a note to the README. I tried to make sure everything in the setup was future proof, but that's pretty tricky.

rgates-fieldwire commented 1 year ago

Fair, I discovered the pain that is NPM having dependency issues. When I was trying to trouble shoot the issue. Easy enough to work around though. I'm reading the book to learn about Wasm not Node.js.

paytonrules commented 1 year ago

Well I wrote the book to use Rust instead of JavaScript - but you can't 100% get away, at least not yet.

david-wallace-croft commented 1 year ago

I am seeing the issue too after upgrading my node.js. Found this link: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported