diff --git a/package.json b/package.json index fd9664585..512b81216 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "@types/body-parser": "^1.19.5", "@types/csurf": "^1.11.5", "@types/jsonwebtoken": "^9.0.7", - "@types/node": "22.7.9", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.1", "@types/uuid": "^8.3.4", @@ -90,7 +89,7 @@ "@types/cookie-parser": "^1.4.7", "@types/express": "^4.17.13", "@types/loglevel": "^1.6.3", - "@types/node": "22.7.9", + "@types/node": "^22.7.9", "@types/node-cron": "^3.0.11", "@types/prismjs": "^1.26.0", "@types/react-highlight": "^0.12.5", @@ -103,7 +102,7 @@ "concurrently": "^7.0.0", "cross-env": "^7.0.3", "nodemon": "^2.0.15", - "ts-node": "^10.4.0", + "ts-node": "^10.9.2", "vite": "^5.4.10" } } diff --git a/server/src/server.ts b/server/src/server.ts index e6fee5f29..700d7d58a 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -8,9 +8,7 @@ import { record, workflow, storage, auth, integration, proxy } from './routes'; import { BrowserPool } from "./browser-management/classes/BrowserPool"; import logger from './logger'; import { connectDB, syncDB } from './storage/db' -import bodyParser from 'body-parser'; import cookieParser from 'cookie-parser'; -import csrf from 'csurf'; import { SERVER_PORT } from "./constants/config"; import { Server } from "socket.io"; import { readdirSync } from "fs" @@ -68,7 +66,11 @@ const workerPath = path.resolve(__dirname, isProduction ? './worker.js' : './wor let workerProcess: any; if (!isProduction) { workerProcess = fork(workerPath, [], { - execArgv: ['--inspect=5859'], + execArgv: [ + '--inspect=5859', + '--loader=ts-node/esm', + '--no-warnings=ExperimentalWarning' + ], }); workerProcess.on('message', (message: any) => { console.log(`Message from worker: ${message}`); diff --git a/server/src/worker.ts b/server/src/worker.ts index fd3470d49..5b32d56f5 100644 --- a/server/src/worker.ts +++ b/server/src/worker.ts @@ -5,11 +5,6 @@ import { handleRunRecording } from "./workflow-management/scheduler"; import Robot from './models/Robot'; import { computeNextRun } from './utils/schedule'; -console.log('Environment variables:', { - REDIS_HOST: process.env.REDIS_HOST, - REDIS_PORT: process.env.REDIS_PORT, -}); - const connection = new IORedis({ host: process.env.REDIS_HOST, port: process.env.REDIS_PORT ? parseInt(process.env.REDIS_PORT, 10) : 6379, diff --git a/tsconfig.json b/tsconfig.json index cbbbc7442..1aaf0835e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "strict": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, - "module": "esnext", + "module": "CommonJS", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true,