Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\NormalModule.js:471:10)
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\NormalModule.js:503:5
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\NormalModule.js:358:12
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\react-scripts\scripts\start.js:19
throw err;
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\NormalModule.js:417:16)
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\NormalModule.js:452:10
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\webpack\lib\NormalModule.js:323:13
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at D:\SourceCode\GitHub\DAML\daml-first-project\create-daml-app\ui\node_modules\babel-loader\lib\index.js:59:103 {
opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
library: ‘digital envelope routines’,
reason: ‘unsupported’,
code: ‘ERR_OSSL_EVP_UNSUPPORTED’
}
ECONNREFUSED (Connection refused): No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host
How to triage this issue now, it seems like openssl incompatibility must be playing a part here.
ECONNREFUSED usually means that there is no program listening to the given port. In this case, this may indicate that you have not started the JSON API server. In the case of the create-daml-app template, before you can run npm start, you need to have daml start running.
Otherwise, you’re essentially running your frontend server with no backend server, which does not work.
Hi, I was getting the same error as the one in the post. and did set NODE_OPTIONS …
However, now when I run “npm start” - I get the following error:
C:\Program Files\nodejs\node.exe: -openssl-legacy-provider is not allowed in NODE_OPTIONS
Here are my version specs: daml version: 2.4.0 (project SDK version from daml.yaml) node -v: v19.2.0 java -version:
openjdk version “17.0.5” 2022-10-18
OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8)
OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)
This worked! It launched the daml App. However, now I have a new issue:
When I try to enter “alice” or “bob” to log in, I get a: Failed to login as ‘alice’ SyntaxError:Unexpected token ‘E’, “Error occu”… is not valid JSON
Is it because I have a version 19 for the node.js or is it something else?
@dzubarchuk
I don’t think this error is related to the version of Node you’re using. This error could indicate that your Node application cannot communicate with the HTTP JSON API server. E.g. it could be that the HTTP JSON API server, that allows your Node application to submit commands to the ledger, is not running. What Daml app are you launching and how are you launching it?
I believe this is indeed related to Node 19. Here is what I think is happening:
Node 19 (as well as the latest versions of Node 18, actually) now resolves localhost to ::1, whereas the JSON API only binds to 127.0.0.1 (IPv6 v. IPv4). So the Node development server started by npm start tries to connect to ::1, gets a “connection refused”, returns that to our Daml code (Error occured when trying to connect: connection refused), which is expecting JSON and thus fails to parse that as JSON on the first character as E is not valid there (for valid JSON it can only be one of ", [, {, t, f, n, or a digit).
If that is indeed your issue, the easiest fix is to replace all occurrences of localhost with 127.0.0.1 manually. There is one occurrence in ui/package.json and one in ui/src/setupProxy.js.