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.
This commit is contained in:
Michel Roegl-Brunner
2025-10-24 12:48:22 +02:00
parent bb4eb2964b
commit 82b2012f50

View File

@@ -1,6 +1,7 @@
import { writeFile, mkdir } from 'fs/promises'; import { writeFile, mkdir } from 'fs/promises';
import { readFileSync, readdirSync, statSync, utimesSync } from 'fs'; import { readFileSync, readdirSync, statSync, utimesSync } from 'fs';
import { join } from 'path'; import { join } from 'path';
import { Buffer } from 'buffer';
export class GitHubJsonService { export class GitHubJsonService {
constructor() { constructor() {