From 86060456fac922b34a833dbc0dc1b4c86d2d3bdc Mon Sep 17 00:00:00 2001 From: isra el Date: Sun, 14 Dec 2025 15:01:26 +0300 Subject: [PATCH] fix(api): fix build issues --- api/package.json | 2 +- api/src/main.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/package.json b/api/package.json index 76df71f..5389aa4 100644 --- a/api/package.json +++ b/api/package.json @@ -11,7 +11,7 @@ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", - "start": "node dist/src/main", + "start": "node dist/main.js", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", diff --git a/api/src/main.ts b/api/src/main.ts index 7dc1bff..280a681 100644 --- a/api/src/main.ts +++ b/api/src/main.ts @@ -1,4 +1,5 @@ import 'dotenv/config' +import * as crypto from 'crypto' import { VersioningType, Logger } from '@nestjs/common' import { NestFactory } from '@nestjs/core' import { AppModule } from './app.module' @@ -7,6 +8,11 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger' import * as express from 'express' import { NestExpressApplication } from '@nestjs/platform-express' +// Ensure crypto is available globally for @nestjs/schedule +if (typeof globalThis.crypto === 'undefined') { + globalThis.crypto = crypto as any +} + // Global error handlers to prevent server crashes const logger = new Logger('GlobalErrorHandler')