From 57ddbc474fe0582d906094dc88b92f47e3959647 Mon Sep 17 00:00:00 2001 From: nikhil2004 Date: Sat, 19 Sep 2026 01:03:42 +0530 Subject: [PATCH] fix(network): correctly resolve health.proto path for gRPC monitors and include in build Fixes #3970 by pointing protoPath to the correct relative directory (../protos) and adding a step in the package.json build script to copy the protos directory to the final dist output. --- server/package.json | 2 +- server/src/service/network/GrpcProvider.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/package.json b/server/package.json index 36906c936..b35ea1eae 100755 --- a/server/package.json +++ b/server/package.json @@ -15,7 +15,7 @@ "worker": "QUEUE_MODE=worker node ./dist/index.js", "worker:dev": "QUEUE_MODE=worker nodemon --exec tsx src/index.js", "clean": "rm -rf dist", - "build": "npm run clean && npm run build:openapi && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && cp -r src/templates dist/templates", + "build": "npm run clean && npm run build:openapi && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && cp -r src/templates dist/templates && mkdir -p dist/service && cp -r src/service/protos dist/service/", "typeCheck": "tsc --noEmit", "build:openapi": "tsc --noEmit && tsx scripts/buildOpenApi.ts", "lint": "eslint .", diff --git a/server/src/service/network/GrpcProvider.ts b/server/src/service/network/GrpcProvider.ts index 340fdc01a..411a11f9d 100644 --- a/server/src/service/network/GrpcProvider.ts +++ b/server/src/service/network/GrpcProvider.ts @@ -64,7 +64,7 @@ export class GrpcProvider implements IStatusProvider { const target = `${host}:${port}`; const currentFilePath = fileURLToPath(import.meta.url); - const protoPath = path.join(path.dirname(currentFilePath), "protos", "health.proto"); + const protoPath = path.join(path.dirname(currentFilePath), "..", "protos", "health.proto"); const packageDefinition = this.protoLoader.loadSync(protoPath, { keepCase: true, longs: String,