fix(migration): ESM imports not working on Windows

This commit is contained in:
Elian Doran 2025-03-02 20:23:38 +02:00
parent f04e747786
commit b4310b5275
No known key found for this signature in database

View File

@ -106,7 +106,7 @@ async function executeMigration(mig: MigrationInfo) {
} else if (mig.type === "js" || mig.type === "ts") { } else if (mig.type === "js" || mig.type === "ts") {
console.log("Migration with JS module"); console.log("Migration with JS module");
const migrationModule = await import(`${resourceDir.MIGRATIONS_DIR}/${mig.file}`); const migrationModule = await import(`file://${resourceDir.MIGRATIONS_DIR}/${mig.file}`);
await migrationModule.default(); await migrationModule.default();
} else { } else {
throw new Error(`Unknown migration type '${mig.type}'`); throw new Error(`Unknown migration type '${mig.type}'`);