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

Fails to run with latest node #214

Open
mimi89999 opened this issue Sep 23, 2024 · 3 comments
Open

Fails to run with latest node #214

mimi89999 opened this issue Sep 23, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mimi89999
Copy link

Hello,

When running under Node v20.17.0, I'm affected by webpack/webpack#14532 and getting the following error:

michel@debian:/dev/shm/wasm-test/www$ npm run start

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

(node:651137) [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 /dev/shm/wasm-test/www
node:internal/crypto/hash:79
  this[kHandle] = new _Hash(algorithm, xofLen, algorithmId, getHashCache());
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (/dev/shm/wasm-test/www/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/dev/shm/wasm-test/www/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/dev/shm/wasm-test/www/node_modules/webpack/lib/NormalModule.js:471:10)
    at /dev/shm/wasm-test/www/node_modules/webpack/lib/NormalModule.js:503:5
    at /dev/shm/wasm-test/www/node_modules/webpack/lib/NormalModule.js:358:12
    at /dev/shm/wasm-test/www/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/dev/shm/wasm-test/www/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/dev/shm/wasm-test/www/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/dev/shm/wasm-test/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
    at /dev/shm/wasm-test/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
    at /dev/shm/wasm-test/www/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
  opensslErrorStack: [
    'error:03000086:digital envelope routines::initialization error',
    'error:0308010C:digital envelope routines::unsupported'
  ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v20.17.0
@mimi89999 mimi89999 added the bug Something isn't working label Sep 23, 2024
@ckriutz
Copy link

ckriutz commented Oct 10, 2024

Adding to this, I get the same error when running on node 18.18.1

vscode ➜ /workspaces/wasm-game-of-life/www (master) $ npm run start

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

(node:15498) [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 /workspaces/wasm-game-of-life/www
node:internal/crypto/hash:69
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/workspaces/wasm-game-of-life/www/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/workspaces/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/workspaces/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:471:10)
    at /workspaces/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:503:5
    at /workspaces/wasm-game-of-life/www/node_modules/webpack/lib/NormalModule.js:358:12
    at /workspaces/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/workspaces/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/workspaces/wasm-game-of-life/www/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/workspaces/wasm-game-of-life/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
    at /workspaces/wasm-game-of-life/www/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
    at /workspaces/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.18.1

@graydenshand
Copy link

Some workarounds

  1. From a related issue in wasm_game_of_life repo: Tutorial does not work due to outdated npm depenencies wasm_game_of_life#115

Start app with

NODE_OPTIONS=--openssl-legacy-provider npm run start
  1. Update dependencies
"devDependencies": {
    "hello-wasm-pack": "^0.1.0",
    "webpack": "^5.95.0",
    "webpack-cli": "^5.1.4",
    "webpack-dev-server": "^5.1.0",
    "copy-webpack-plugin": "^12.0.2"
  }

With those dependency updates, I also needed to change the webpack.config.js (only changes shown)

  plugins: [
    new CopyWebpackPlugin({patterns: ['index.html']})
  ],
  experiments: {
    asyncWebAssembly: true,
  },

@graydenshand
Copy link

There's already an open PR for this #211

From August 2023... I guess this repo's dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants