Skip to content

Commit 82b2012

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

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/server/services/githubJsonService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { writeFile, mkdir } from 'fs/promises';
22
import { readFileSync, readdirSync, statSync, utimesSync } from 'fs';
33
import { join } from 'path';
4+
import { Buffer } from 'buffer';
45

56
export class GitHubJsonService {
67
constructor() {

0 commit comments

Comments
 (0)