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

create-wasm-app won't run on node 18 on windows #279

Open
Kreijstal opened this issue Oct 7, 2022 · 4 comments
Open

create-wasm-app won't run on node 18 on windows #279

Kreijstal opened this issue Oct 7, 2022 · 4 comments

Comments

@Kreijstal
Copy link

as it is, it won't run thanks to very outdated dependencies. Maybe simply don't use the bundler at all?

> npm run start

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

(node:33908) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
i 「wds」: Project is running at http://localhost:8080/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from %HOME%\ok\wasm\wasm-test\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 (%HOME%\ok\wasm\wasm-test\www\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (%HOME%\ok\wasm\wasm-test\www\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (%HOME%\ok\wasm\wasm-test\www\node_modules\webpack\lib\NormalModule.js:471:10)
    at %HOME%\ok\wasm\wasm-test\www\node_modules\webpack\lib\NormalModule.js:503:5
    at %HOME%\ok\wasm\wasm-test\www\node_modules\webpack\lib\NormalModule.js:358:12
    at %HOME%\ok\wasm\wasm-test\www\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (%HOME%\ok\wasm\wasm-test\www\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at Array.<anonymous> (%HOME%\ok\wasm\wasm-test\www\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (%HOME%\ok\wasm\wasm-test\www\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:43:16)
    at %HOME%\ok\wasm\wasm-test\www\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:79:9
    at %HOME%\ok\wasm\wasm-test\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.6.0
@rezzaghi
Copy link

Same problem here.
For a temporary fix, use node 16 or any version below 16.

@heydamianc
Copy link

This pull request adds a hint to a solution for this while keeping a newer version of node.

The suggestion is to add a NODE_OPTIONS environment variable that includes the --openssl-legacy-provider flag. I tested this with the following package.json file and it worked for me.

{
  ...
  "scripts": {
    ...
    "start": "NODE_OPTIONS=--openssl-legacy-provider webpack-dev-server"
  },
  ...
}

@Chubercik
Copy link

Chubercik commented Feb 5, 2023

If you want to change the environment variable on Windows you can run this command in the terminal before running npm run start:

$env:NODE_OPTIONS="--openssl-legacy-provider"

Edit: alternative solution

@tjwelde
Copy link

tjwelde commented Feb 18, 2023

Same issue on macos. Downgrading to node 16 works.

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

No branches or pull requests

5 participants