From 3681c7725a479360555b016c9eb3c9230d8a9d64 Mon Sep 17 00:00:00 2001 From: Ian Rohde Date: Thu, 1 Oct 2026 17:07:01 -0700 Subject: [PATCH] bin/migrate: import readFileSync from fs, not fs/promises bin/migrate crashes before it connects to the database: > SyntaxError: The requested module 'fs/promises' does not provide an > export named 'readFileSync' The ESM conversion in 48b6d14 swapped the fs.readFile callback for readFileSync but imported it from fs/promises, which only has the promise versions (readFile, no readFileSync). Node rejects the named import while loading the module, so no line of the script runs. entrypoint.sh runs bin/migrate up to 5 times, 10 seconds apart, then starts pulldasher anyway, so a fresh docker-compose database never gets the schema. Verified against MySQL 8.4.9 under Node 24: the script exits 0 and creates all 7 tables in migrations/schema.sql, and a second run also exits 0. Claude-Session: https://claude.ai/code/session_01XSa8s7HS2UvFG9Fo9k2oJS --- bin/migrate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/migrate b/bin/migrate index a925d6d8..8ac94f8d 100755 --- a/bin/migrate +++ b/bin/migrate @@ -1,7 +1,7 @@ #!/usr/bin/env node import { createConnection } from 'mysql2'; -import { readFileSync } from 'fs/promises'; +import { readFileSync } from 'fs'; import config from '../lib/config-loader.js'; const db = createConnection({