From bb4eb2964ba934b1f021cdc9e984c8708f8d515d Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Fri, 24 Oct 2025 12:46:50 +0200 Subject: [PATCH] fix: Remove CommonJS require() calls in ES module context - Fixed 'require is not defined' error in githubJsonService.js - Imported utimesSync from fs module instead of using require('fs').utimesSync - Auto-sync now works without ES module errors The JSON sync now completes successfully without any require() errors. --- src/server/services/githubJsonService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/services/githubJsonService.js b/src/server/services/githubJsonService.js index 0f8d514..d8bcc4b 100644 --- a/src/server/services/githubJsonService.js +++ b/src/server/services/githubJsonService.js @@ -1,5 +1,5 @@ import { writeFile, mkdir } from 'fs/promises'; -import { readFileSync, readdirSync, statSync } from 'fs'; +import { readFileSync, readdirSync, statSync, utimesSync } from 'fs'; import { join } from 'path'; export class GitHubJsonService { @@ -161,7 +161,7 @@ export class GitHubJsonService { // Update file modification time to match remote const remoteMtime = new Date(file.updated_at); - require('fs').utimesSync(localPath, remoteMtime, remoteMtime); + utimesSync(localPath, remoteMtime, remoteMtime); syncedCount++; syncedFiles.push(file.name);