diff --git a/packages/cli-v3/src/commands/dev.tsx b/packages/cli-v3/src/commands/dev.tsx index 6a6a3e003..a692b3bd1 100644 --- a/packages/cli-v3/src/commands/dev.tsx +++ b/packages/cli-v3/src/commands/dev.tsx @@ -536,21 +536,25 @@ function useDev({ const processEnv = await gatherProcessEnv(); - const backgroundWorker = new BackgroundWorker(fullPath, { - projectConfig: config, - dependencies, - env: { - ...processEnv, - TRIGGER_API_URL: apiUrl, - TRIGGER_SECRET_KEY: apiKey, - ...(environmentVariablesResponse.success - ? environmentVariablesResponse.data.variables - : {}), + const backgroundWorker = new BackgroundWorker( + fullPath, + { + projectConfig: config, + dependencies, + env: { + ...processEnv, + TRIGGER_API_URL: apiUrl, + TRIGGER_SECRET_KEY: apiKey, + ...(environmentVariablesResponse.success + ? environmentVariablesResponse.data.variables + : {}), + }, + debuggerOn, + debugOtel, + resolveEnvVariables: createResolveEnvironmentVariablesFunction(configModule), }, - debuggerOn, - debugOtel, - resolveEnvVariables: createResolveEnvironmentVariablesFunction(configModule), - }); + environmentClient + ); try { await backgroundWorker.initialize(); diff --git a/packages/cli-v3/src/workers/dev/backgroundWorker.ts b/packages/cli-v3/src/workers/dev/backgroundWorker.ts index bfb95cda2..6b6b21587 100644 --- a/packages/cli-v3/src/workers/dev/backgroundWorker.ts +++ b/packages/cli-v3/src/workers/dev/backgroundWorker.ts @@ -46,7 +46,6 @@ import { UncaughtExceptionError, UnexpectedExitError, } from "../common/errors.js"; -import { env } from "node:process"; import { CliApiClient } from "../../apiClient.js"; export type CurrentWorkers = BackgroundWorkerCoordinator["currentWorkers"]; @@ -290,7 +289,8 @@ export class BackgroundWorker { constructor( public path: string, - public params: BackgroundWorkerParams + public params: BackgroundWorkerParams, + private apiClient: CliApiClient ) {} close() {