Fix bin/migrate crash on the fs/promises import - #509
Open
probablyian wants to merge 1 commit into
Open
probablyian wants to merge 1 commit into
probablyian wants to merge 1 commit into
Conversation
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
probablyian
marked this pull request as ready for review
October 2, 2026 00:10
Member
Author
|
QA 🟢
Tested
Not tested
Command output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bin/migratecrashes before it connects to the database, so a fresh docker-compose setup never gets its tables.entrypoint.shtries it 5 times, 10 seconds apart, then starts pulldasher against an empty database.The ESM conversion in 48b6d14 imported
readFileSyncfromfs/promises, which only has the promise versions, so Node refuses to load the script:This imports it from
fsinstead. Checked against MySQL 8.4.9 under Node 24: the script exits 0 and creates all 7 tables inmigrations/schema.sql, and a second run also exits 0.QA
node bin/migrate. Confirm it exits 0.SHOW TABLESon that database. Confirm it lists 7 tables.node bin/migrateagain. Confirm it still exits 0.https://claude.ai/code/session_01XSa8s7HS2UvFG9Fo9k2oJS