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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user