[object Object]

← back to Ventura Corridor

fix: gallery-pieces 3am job — require('pg') → import (package is type:module, was throwing ReferenceError nightly since May 12)

7004f124506e1252c1129633125703cf8df61883 · 2026-06-02 12:44:03 -0700 · SteveStudio2

The launchd com.steve.ventura-gallery-3am step 3 (generate-gallery-pieces.js) crashed
immediately on 'require is not defined in ES module scope'. Converted to ESM import;
keeps the filename so the plist reference is unaffected. Writes to LOCAL ventura_corridor
DB (/tmp socket), not prod. Next 3am run will resume gallery generation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 7004f124506e1252c1129633125703cf8df61883
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Tue Jun 2 12:44:03 2026 -0700

    fix: gallery-pieces 3am job — require('pg') → import (package is type:module, was throwing ReferenceError nightly since May 12)
    
    The launchd com.steve.ventura-gallery-3am step 3 (generate-gallery-pieces.js) crashed
    immediately on 'require is not defined in ES module scope'. Converted to ESM import;
    keeps the filename so the plist reference is unaffected. Writes to LOCAL ventura_corridor
    DB (/tmp socket), not prod. Next 3am run will resume gallery generation.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 scripts/generate-gallery-pieces.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/generate-gallery-pieces.js b/scripts/generate-gallery-pieces.js
index dced859..e3f8b5e 100644
--- a/scripts/generate-gallery-pieces.js
+++ b/scripts/generate-gallery-pieces.js
@@ -6,7 +6,8 @@
 // Category priority (highest first): restaurants, salons, hotels, cafes,
 // law firms, clinics, dentists, then the rest. Stops at --limit.
 
-const { Client } = require('pg');
+import pg from 'pg';
+const { Client } = pg;
 
 const args = process.argv.slice(2);
 const arg = (k, d) => { const i = args.indexOf(k); return i >= 0 ? args[i+1] : d; };

← b261b8f Link favicon.svg in head (use branded SVG, not .ico fallback  ·  back to Ventura Corridor  ·  ad-signals: read-only pass-1 ad/social tracker over crawled 057d452 →