Skip to content

Commit b53acad

Browse files
author
SSMG4
committed
fix(server): use createRequire for archiver — v8 dropped default ESM export
1 parent 9b0b38f commit b53acad

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎server/index.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,10 @@ app.post('/api/exec', async (req, res) => {
431431

432432
// ─── Archive ─────────────────────────────────────────────────────────────────
433433

434+
import { createRequire } from 'module';
435+
const _require = createRequire(import.meta.url);
436+
const archiver = _require('archiver');
434437
import StreamZip from 'node-stream-zip';
435-
import archiver from 'archiver';
436438

437439
const ARCHIVE_MAX_SIZE = 2 * 1024 * 1024 * 1024; // 2 GB uncompressed limit
438440
const ARCHIVE_MAX_RATIO = 100; // zip bomb: >100:1 ratio is rejected

0 commit comments

Comments
 (0)