From 82b2012f50676eb9ea9a42234f6507027b33a43e Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Fri, 24 Oct 2025 12:48:22 +0200 Subject: [PATCH] fix: Import Buffer explicitly for ES module compatibility - Added import { Buffer } from 'buffer' to githubJsonService.js - Fixed 'require is not defined' error when using Buffer.from() in ES modules - Auto-sync now works correctly through both direct execution and web API The Buffer global is not available in ES module context, so it needs to be explicitly imported. This fixes the sync errors that were occurring when the auto-sync service was called through the web interface. --- src/server/services/githubJsonService.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/services/githubJsonService.js b/src/server/services/githubJsonService.js index d8bcc4b..a5cdb6a 100644 --- a/src/server/services/githubJsonService.js +++ b/src/server/services/githubJsonService.js @@ -1,6 +1,7 @@ import { writeFile, mkdir } from 'fs/promises'; import { readFileSync, readdirSync, statSync, utimesSync } from 'fs'; import { join } from 'path'; +import { Buffer } from 'buffer'; export class GitHubJsonService { constructor() {