Skip to content

Commit bb4eb29

Browse files
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.
1 parent a6a02a1 commit bb4eb29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/services/githubJsonService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { writeFile, mkdir } from 'fs/promises';
2-
import { readFileSync, readdirSync, statSync } from 'fs';
2+
import { readFileSync, readdirSync, statSync, utimesSync } from 'fs';
33
import { join } from 'path';
44

55
export class GitHubJsonService {
@@ -161,7 +161,7 @@ export class GitHubJsonService {
161161

162162
// Update file modification time to match remote
163163
const remoteMtime = new Date(file.updated_at);
164-
require('fs').utimesSync(localPath, remoteMtime, remoteMtime);
164+
utimesSync(localPath, remoteMtime, remoteMtime);
165165

166166
syncedCount++;
167167
syncedFiles.push(file.name);

0 commit comments

Comments
 (0)