diff --git a/lib/env/migrationsDir.js b/lib/env/migrationsDir.js index 906234c..2447701 100644 --- a/lib/env/migrationsDir.js +++ b/lib/env/migrationsDir.js @@ -102,7 +102,7 @@ module.exports = { const result = moduleLoader.require(migrationPath); return getModuleExports(result); } catch (e) { - if (e.code === 'ERR_REQUIRE_ESM') { + if (e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_REQUIRE_ASYNC_MODULE') { const loadedImport = moduleLoader.import(url.pathToFileURL(migrationPath)); return getModuleExports(loadedImport); }