From 9485e2f12a4131ec24f504591290246e24f1cd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 6 Dec 2022 12:16:49 +0100 Subject: [PATCH] fix: Enable source-maps on WorkflowRunnerProcess in `own` mode (#4832) --- packages/cli/bin/n8n | 4 +--- packages/cli/package.json | 4 ++-- packages/cli/src/ActiveExecutions.ts | 2 +- packages/cli/src/Interfaces.ts | 2 +- packages/cli/src/WorkflowRunnerProcess.ts | 1 + pnpm-lock.yaml | 3 +-- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/cli/bin/n8n b/packages/cli/bin/n8n index 3b0b3c9297..db16c9fb3c 100755 --- a/packages/cli/bin/n8n +++ b/packages/cli/bin/n8n @@ -29,9 +29,7 @@ if (![14, 16, 18].includes(nodeVersionMajor)) { process.exit(1); } -try { - require('source-map-support').install(); -} catch {} +require('source-map-support').install(); require('@oclif/command') .run() diff --git a/packages/cli/package.json b/packages/cli/package.json index 3883dbe784..55a440d981 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -97,7 +97,6 @@ "concurrently": "^5.1.0", "nodemon": "^2.0.2", "run-script-os": "^1.0.7", - "source-map-support": "^0.5.21", "supertest": "^6.2.2", "ts-node": "^9.1.1", "tsc-alias": "^1.7.0", @@ -164,14 +163,15 @@ "passport": "^0.6.0", "passport-cookie": "^1.0.9", "passport-jwt": "^4.0.0", - "picocolors": "^1.0.0", "pg": "^8.3.0", + "picocolors": "^1.0.0", "posthog-node": "^1.3.0", "prom-client": "^13.1.0", "psl": "^1.8.0", "replacestream": "^4.0.3", "semver": "^7.3.8", "shelljs": "^0.8.5", + "source-map-support": "^0.5.21", "sqlite3": "^5.1.2", "sse-channel": "^3.1.1", "swagger-ui-express": "^4.3.0", diff --git a/packages/cli/src/ActiveExecutions.ts b/packages/cli/src/ActiveExecutions.ts index 7781f2e614..fa96f4967c 100644 --- a/packages/cli/src/ActiveExecutions.ts +++ b/packages/cli/src/ActiveExecutions.ts @@ -12,7 +12,7 @@ import { IRun, } from 'n8n-workflow'; -import { ChildProcess } from 'child_process'; +import type { ChildProcess } from 'child_process'; import { stringify } from 'flatted'; import PCancelable from 'p-cancelable'; import * as Db from '@/Db'; diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index b30b6ca62e..fa442b892e 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -26,7 +26,7 @@ import { WorkflowExecute } from 'n8n-core'; import PCancelable from 'p-cancelable'; import type { FindOperator, Repository } from 'typeorm'; -import { ChildProcess } from 'child_process'; +import type { ChildProcess } from 'child_process'; import { Url } from 'url'; import type { Request } from 'express'; diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index f22a2d0d45..0aaf0edcec 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -6,6 +6,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-use-before-define */ /* eslint-disable @typescript-eslint/unbound-method */ +import 'source-map-support/register'; import { BinaryDataManager, IProcessMessage, UserSettings, WorkflowExecute } from 'n8n-core'; import { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5c91f7dd89..fb394fe092 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -276,6 +276,7 @@ importers: replacestream: 4.0.3 semver: 7.3.8 shelljs: 0.8.5 + source-map-support: 0.5.21 sqlite3: 5.1.2 sse-channel: 3.1.1 swagger-ui-express: 4.5.0_express@4.18.2 @@ -322,7 +323,6 @@ importers: concurrently: 5.3.0 nodemon: 2.0.20 run-script-os: 1.1.6 - source-map-support: 0.5.21 supertest: 6.3.0 ts-node: 9.1.1_typescript@4.8.4 tsc-alias: 1.7.1 @@ -19204,7 +19204,6 @@ packages: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 - dev: true /source-map-url/0.4.1: resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==}