From bef5bef8751b87326236eb78d699116578f0596b Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 28 Nov 2025 13:32:51 +0100 Subject: [PATCH] Remove .js extensions from dynamic imports --- src/app/api/settings/auto-sync/route.ts | 10 +++++----- src/server/services/autoSyncService.js | 2 +- src/server/services/localScripts.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/api/settings/auto-sync/route.ts b/src/app/api/settings/auto-sync/route.ts index b8870d5..f3cd79c 100644 --- a/src/app/api/settings/auto-sync/route.ts +++ b/src/app/api/settings/auto-sync/route.ts @@ -176,12 +176,12 @@ export async function POST(request: NextRequest) { // Reschedule auto-sync service with new settings try { - const { getAutoSyncService, setAutoSyncService } = await import('../../../../server/lib/autoSyncInit.js'); + const { getAutoSyncService, setAutoSyncService } = await import('../../../../server/lib/autoSyncInit'); let autoSyncService = getAutoSyncService(); // If no global instance exists, create one if (!autoSyncService) { - const { AutoSyncService } = await import('../../../../server/services/autoSyncService.js'); + const { AutoSyncService } = await import('../../../../server/services/autoSyncService'); autoSyncService = new AutoSyncService(); setAutoSyncService(autoSyncService); } @@ -205,7 +205,7 @@ export async function POST(request: NextRequest) { // Ensure the service is completely stopped and won't restart autoSyncService.isRunning = false; // Also stop the global service instance if it exists - const { stopAutoSync: stopGlobalAutoSync } = await import('../../../../server/lib/autoSyncInit.js'); + const { stopAutoSync: stopGlobalAutoSync } = await import('../../../../server/lib/autoSyncInit'); stopGlobalAutoSync(); } } catch (error) { @@ -322,7 +322,7 @@ async function handleTestNotification() { } // Send test notification using the auto-sync service - const { AutoSyncService } = await import('../../../../server/services/autoSyncService.js'); + const { AutoSyncService } = await import('../../../../server/services/autoSyncService'); const autoSyncService = new AutoSyncService(); const result = await autoSyncService.testNotification(); @@ -370,7 +370,7 @@ async function handleManualSync() { } // Trigger manual sync using the auto-sync service - const { AutoSyncService } = await import('../../../../server/services/autoSyncService.js'); + const { AutoSyncService } = await import('../../../../server/services/autoSyncService'); const autoSyncService = new AutoSyncService(); const result = await autoSyncService.executeAutoSync() as { success: boolean; message?: string } | null; diff --git a/src/server/services/autoSyncService.js b/src/server/services/autoSyncService.js index bca5a8f..057595d 100644 --- a/src/server/services/autoSyncService.js +++ b/src/server/services/autoSyncService.js @@ -376,7 +376,7 @@ export class AutoSyncService { console.log(`Processing ${syncResult.syncedFiles.length} synced JSON files for script downloads...`); // Get scripts only for the synced files - const localScriptsService = await import('./localScripts.js'); + const localScriptsService = await import('./localScripts'); const syncedScripts = []; for (const filename of syncResult.syncedFiles) { diff --git a/src/server/services/localScripts.ts b/src/server/services/localScripts.ts index 8586f2b..b94eabb 100644 --- a/src/server/services/localScripts.ts +++ b/src/server/services/localScripts.ts @@ -96,7 +96,7 @@ export class LocalScriptsService { let foundRepo: string | null = null; for (const repo of enabledRepos) { try { - const { githubJsonService } = await import('./githubJsonService.js'); + const { githubJsonService } = await import('./githubJsonService'); const repoScript = await githubJsonService.getScriptBySlug(slug, repo.url); if (repoScript) { foundRepo = repo.url;