apache / apisix-dashboard

Dashboard for Apache APISIX
https://apisix.apache.org/
Apache License 2.0
1.01k stars 528 forks source link

ERR_OSSL_EVP_UNSUPPORTED error while building APISIX Dashboard #2841

Open anandasastry opened 1 year ago

anandasastry commented 1 year ago

Issue description

I am trying to build APISIX Dashboard from source using the steps mentioned in https://apisix.apache.org/docs/dashboard/install/. I have the below dependencies installed on my machine

Golang 1.20.6 Node.js 18.17.0 Enabled Corepack for Yarn

I have updated the Makefile to remove the --ignore-scripts in the below line, as yarn does not support this option

.PHONY: build build: web-default api-default api/build.sh && cd ./web && export CYPRESS_INSTALL_BINARY=0 && yarn install --ignore-scripts && yarn build && mkdir -p ../output/logs

When I execute the "make build" command, I receive the below error

Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:69:19) at Object.createHash (node:crypto:133:10)

Expected behavior

The build to be successful

How to Reproduce

  1. Install Golang 1.20.6
  2. Node.js 18.17.0
  3. Enable Corepack for Yarn (corepack enable)
  4. Update Makefile by removing "--ignore-scripts" under build step
  5. Execute "make build"

Screenshots

No response

Environment

Additional context

No response

leowmjw commented 1 year ago

@anandasastry Until there is a fix; here's a workaround:

diff --git a/web/package.json b/web/package.json
index bd2b6f12..b6981612 100644
--- a/web/package.json
+++ b/web/package.json
@@ -7,7 +7,7 @@
     "prepare": "cd .. && husky install web/.husky",
     "analyze": "cross-env ANALYZE=1 yarn run build",
     "copy-folder": "node --experimental-modules copy-folder.mjs",
-    "build": "yarn copy-folder monaco-editor ./public/ && NODE_OPTIONS=--max_old_space_size=4096 umi build",
+    "build": "yarn copy-folder monaco-editor ./public/ && NODE_OPTIONS=\"--max_old_space_size=4096  --openssl-legacy-provider\" umi build",
     "dev": "yarn run start:dev",
     "fetch:blocks": "pro fetch-blocks --branch antd@4 && yarn run prettier",
     "i18n-remove": "pro i18n-remove --locale=zh-CN --write",
leowmjw commented 1 year ago

System:

$  apisix-dashboard git:(master) ✗ openssl version
OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023)
$  apisix-dashboard git:(master) ✗ node -v
v18.17.0
$  apisix-dashboard git:(master) ✗ yarn -v
1.22.19
$  apisix-dashboard git:(master) ✗ git log | head
commit e8bc9b94037a1d71728d4fb1f3c2e615485b69e3
Author: Tsui Jie <jndion2014@gmail.com>
Date:   Mon Aug 7 09:10:36 2023 +0800

    fix: upstream discovery args metadata field caused crash. (#2832)

commit e0290c81cb3972978f0d1e3066db4d17dc6c14d1
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue May 30 14:58:26 2023 +0800