Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2] Serving Locally fails #290

Open
crcdng opened this issue Feb 22, 2023 · 3 comments · May be fixed by #293
Open

[4.2] Serving Locally fails #290

crcdng opened this issue Feb 22, 2023 · 3 comments · May be fixed by #293

Comments

@crcdng
Copy link

crcdng commented Feb 22, 2023

Describe the bug

"Serving Locally" fails with this error

> [email protected] start
> webpack-dev-server

(node:63214) [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 /Users/m/root/dev/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:140:10)
    at module.exports (/Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
    at /Users/m/root/dev/wasm/wasm-game-of-life/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
    at /Users/m/root/dev/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 v19.5.0

To Reproduce

Follow the steps in the book up to 4.2 "Serving Locally" on page
https://rustwasm.github.io/docs/book/game-of-life/hello-world.html

Expected behavior
The local dev server should start and serve the page.

@CHATALOT1
Copy link

I am also experiencing this issue (linux). Limited research makes me think it could be openssl related.

OpenSSL Version: 3.0.8
Rust Version: 1.67.1
npm version: 8.19.2
node version: 19.7.0

Any help is appreciated

@nik0sc
Copy link

nik0sc commented Feb 26, 2023

This was mentioned previously in #279 and #273. Some ways to work around it are to either:

  1. add NODE_OPTIONS=--openssl-legacy-provider to your scripts.start in package.json
  2. downgrade to node v16 (using a tool like nvm)
  3. patch your www/package.json and www/webpack.config.js with the versions from from Updated webpack dependencies and allowed web assembly in webpack export create-wasm-app#207

FWIW I think the "right" way to fix it is solution 3. Could someone from @rustwasm approve that PR please?

@Gers2017
Copy link

Gers2017 commented Mar 4, 2023

This was mentioned previously in #279 and #273. Some ways to work around it are to either:

1. add `NODE_OPTIONS=--openssl-legacy-provider` to your `scripts.start` in `package.json`

2. downgrade to node v16 (using a tool like [nvm](https://github.com/nvm-sh/nvm))

3. patch your `www/package.json` and `www/webpack.config.js` with the versions from from [Updated webpack dependencies and allowed web assembly in webpack export create-wasm-app#207](https://github.com/rustwasm/create-wasm-app/pull/207)

FWIW I think the "right" way to fix it is solution 3. Could someone from @rustwasm approve that PR please?

Thank you! This workaround worked for me 👍

@coelhucas coelhucas linked a pull request Apr 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants