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

yarn dev throws a digital envelope error #3

Open
kjczarne opened this issue Nov 3, 2022 · 3 comments
Open

yarn dev throws a digital envelope error #3

kjczarne opened this issue Nov 3, 2022 · 3 comments

Comments

@kjczarne
Copy link

kjczarne commented Nov 3, 2022

Without any modification to the code distributed in this repo. Steps to reproduce:

  1. yarn
  2. yarn dev

Node.JS v18.12.0

Traceback:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at BulkUpdateDecorator.hashFactory (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
    at BulkUpdateDecorator.update (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
    at OriginalSource.updateHash (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack-sources3/index.js:1:10264)
    at NormalModule._initBuildHash (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68468:17)
    at handleParseResult (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68534:10)
    at /home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68628:4
    at processResult (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68343:11)
    at /home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68407:5
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at BulkUpdateDecorator.hashFactory (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
    at BulkUpdateDecorator.update (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
    at OriginalSource.updateHash (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack-sources3/index.js:1:10264)
    at NormalModule._initBuildHash (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68468:17)
    at handleParseResult (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68534:10)
    at /home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68628:4
    at processResult (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68343:11)
    at /home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68407:5
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 BulkUpdateDecorator.hashFactory (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:138971:18)
    at BulkUpdateDecorator.update (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:138872:50)
    at OriginalSource.updateHash (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack-sources3/index.js:1:10264)
    at NormalModule._initBuildHash (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68468:17)
    at handleParseResult (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68534:10)
    at /home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68628:4
    at processResult (/home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68343:11)
    at /home/chris/onnx_demo/node_modules/next/dist/compiled/webpack/bundle5.js:68407:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
@kjczarne
Copy link
Author

kjczarne commented Nov 3, 2022

Same issue observed in: https://github.com/microsoft/onnxruntime-web-demo

@developer239
Copy link

developer239 commented Apr 11, 2023

@kjczarne I made it work with node v14.17.6 and this package.json

{
  "name": "ort-web-template",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build && next export",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "fs": "0.0.1-security",
    "jimp": "0.16.1",
    "lodash": "4.17.21",
    "ndarray": "1.0.19",
    "ndarray-ops": "1.2.2",
    "next": "11.1.2",
    "onnxruntime-web": "1.9.0",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "node-polyfill-webpack-plugin": "1.1.4",
    "copy-webpack-plugin": "9.0.1",
    "@types/lodash": "4.14.176",
    "@types/react": "17.0.19",
    "eslint": "7.32.0",
    "eslint-config-next": "11.1.0",
    "typescript": "4.4.2"
  }
}

@airinterface
Copy link

Before the fix, we can run with below with node v17 and above
export NODE_OPTIONS=--openssl-legacy-provider; npm run dev

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

3 participants