Building and running the webviewer-ui

Hello,

I cloned the GitHub repo of the webviewer-ui, performed an npm install successfully and attempted npm run start.

This is the error I get in response:

webviewer-ui@10.9.0 start
npx babel-node ./dev-server.js

Debugger listening on ws://127.0.0.1:55798/f614f2d8-6081-4795-a302-8a7b0f9be8dd
For help, see: Node.js — Debugging Node.js
Debugger attached.
Listening at localhost:3000 (http://192.168.1.83:3000)
node:internal/crypto/hash:68
this[kHandle] = new _Hash(algorithm, xofLen);
^

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:68:19)
at Object.createHash (node:crypto:138:10)
at module.exports (/Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array. (/Users/klausnji/dev/apryse-co/webviewer-ui/node_modules/loader-runner/lib/LoaderRunner.js:205:4) {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
}

Node.js v20.9.0

For the webviewer-react-sample, I was able to add this parameter --openssl-legacy-provider to the start script to bypass a similar error.

I have tried passing the same option above as a node option to the start script in the webviewer-ui but this does not get rid of the error. I am also running Node 20. Anyone run into this issue?

1 Like

Hi there,

Could you try running this line before npm start?

export NODE_OPTIONS=--openssl-legacy-provider

Best Regards,
Darian

1 Like

Issue resolved!

I had to manually copy the Core folder from node_modules/@pdftron/webviewer to webviewer-ui/lib/

2 Likes

Thanks Darian. I did that, ran a build successfully. However, when I now attempt to run the project, I get a blank screen with these errors:

1 Like

The error that you’re facing is ERR_OSSL_EVP_UNSUPPORTED, which arises when an application needs to use an encryption, decryption, signing, or verification algorithm not supported or implemented by the version of OpenSSL being used. There are different causes for the error to occur, such as:-

  1. Unsupported Algorithm
  2. Incorrect OpenSSL Version
  3. Misconfigured OpenSSL Installation
  4. Missing Libraries
  5. Code Issues

There are different ways to fix it, so you need to understand properly in detail, which may help in solving it.

1 Like