From 7033e2821d066f494707352d4506fe0b3f941b14 Mon Sep 17 00:00:00 2001 From: vgcman16 <155417613+vgcman16@users.noreply.github.com> Date: Thu, 5 Jun 2025 22:03:45 -0500 Subject: [PATCH] Fix dynamic import of child_process --- app/routes/api.system.disk-info.ts | 4 ++-- app/routes/api.system.memory-info.ts | 4 ++-- app/routes/api.system.process-info.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/routes/api.system.disk-info.ts b/app/routes/api.system.disk-info.ts index c520e1bb..a7aea7c1 100644 --- a/app/routes/api.system.disk-info.ts +++ b/app/routes/api.system.disk-info.ts @@ -8,8 +8,8 @@ try { // Check if we're in a Node.js environment if (typeof process !== 'undefined' && process.platform) { // Using dynamic import to avoid require() - const childProcess = { execSync: null }; - execSync = childProcess.execSync; + const { execSync: importedExecSync } = await import('child_process'); + execSync = importedExecSync; } } catch { // In Cloudflare environment, this will fail, which is expected diff --git a/app/routes/api.system.memory-info.ts b/app/routes/api.system.memory-info.ts index a6dc7b51..46ebad5a 100644 --- a/app/routes/api.system.memory-info.ts +++ b/app/routes/api.system.memory-info.ts @@ -8,8 +8,8 @@ try { // Check if we're in a Node.js environment if (typeof process !== 'undefined' && process.platform) { // Using dynamic import to avoid require() - const childProcess = { execSync: null }; - execSync = childProcess.execSync; + const { execSync: importedExecSync } = await import('child_process'); + execSync = importedExecSync; } } catch { // In Cloudflare environment, this will fail, which is expected diff --git a/app/routes/api.system.process-info.ts b/app/routes/api.system.process-info.ts index d3c22066..cd0e0dba 100644 --- a/app/routes/api.system.process-info.ts +++ b/app/routes/api.system.process-info.ts @@ -8,8 +8,8 @@ try { // Check if we're in a Node.js environment if (typeof process !== 'undefined' && process.platform) { // Using dynamic import to avoid require() - const childProcess = { execSync: null }; - execSync = childProcess.execSync; + const { execSync: importedExecSync } = await import('child_process'); + execSync = importedExecSync; } } catch { // In Cloudflare environment, this will fail, which is expected