From dd08f42fb1e301ee5f9a0b43873d8e3fdad831d3 Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Sun, 18 Sep 2022 23:41:04 +0200 Subject: Fix npm dependency issue for server Issue-ID: CCSDK-3754 Signed-off-by: Lukasz Rajewski Change-Id: Id3a43101fcb9b5c5af8d219598283cb57ea8a4d7 (cherry picked from commit 3a31cda1d41e7aa21500a187503b7b637b80e435) --- cds-ui/server/Dockerfile | 2 +- cds-ui/server/package.json | 9 +++++++-- cds-ui/server/pom.xml | 4 ++-- cds-ui/server/src/sequence.ts | 6 ++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cds-ui/server/Dockerfile b/cds-ui/server/Dockerfile index bca90e201..ae6b17598 100644 --- a/cds-ui/server/Dockerfile +++ b/cds-ui/server/Dockerfile @@ -1,5 +1,5 @@ # Check out https://hub.docker.com/_/node to select a new base image -FROM node:10-slim +FROM node:16-slim # Set to a non-root built-in user `node` USER node diff --git a/cds-ui/server/package.json b/cds-ui/server/package.json index 312803b33..aee526a8e 100644 --- a/cds-ui/server/package.json +++ b/cds-ui/server/package.json @@ -45,6 +45,10 @@ "dist/index*", "src" ], + "overrides": { + "@types/express-serve-static-core": "4.17.30", + "express": "4.17.3" + }, "dependencies": { "@grpc/proto-loader": "^0.5.1", "@loopback/boot": "^1.0.8", @@ -60,6 +64,7 @@ "@types/mime": "2.0.3", "@types/uuid": "^3.4.4", "bluebird": "^3.5.3", + "check-node-version": "^4.2.1", "cors": "^2.8.5", "file": "^0.2.2", "file-system": "^2.2.2", @@ -67,7 +72,7 @@ "form-data": "^2.3.3", "formidable": "^1.2.1", "fs": "0.0.1-security", - "grpc": "^1.21.1", + "@grpc/grpc-js": "^1.7.0", "jszip": "^3.2.1", "loopback-connector-rest": "^3.4.1", "multer": "^1.4.1", @@ -85,7 +90,7 @@ "@types/mime": "2.0.3", "@types/multer": "^1.3.7", "@types/multiparty": "0.0.32", - "@types/node": "^10.11.2", + "@types/node": "^17.0.45", "@types/request": "^2.48.1" } } diff --git a/cds-ui/server/pom.xml b/cds-ui/server/pom.xml index 3de20e107..4983f7d12 100644 --- a/cds-ui/server/pom.xml +++ b/cds-ui/server/pom.xml @@ -73,8 +73,8 @@ limitations under the License. 1.12.1 - v8.12.0 - 6.4.1 + v16.14.0 + 8.3.0 https://nodejs.org/dist/ ./ diff --git a/cds-ui/server/src/sequence.ts b/cds-ui/server/src/sequence.ts index 84da5249d..ab796a539 100644 --- a/cds-ui/server/src/sequence.ts +++ b/cds-ui/server/src/sequence.ts @@ -55,8 +55,10 @@ export class MySequence implements SequenceHandler { const args = await this.parseParams(request, route); const result = await this.invoke(route, args); this.send(response, result); - } catch (err) { - this.reject(context, err); + } catch (err: unknown) { + if (err instanceof Error) { + this.reject(context, err); + } } finally { const { authorization, ...headers} = request.headers; logger.info("Incoming request from %s %s and with header %s query %s params %s and response code: %s", -- cgit 1.2.3-korg