diff --git a/packages/db/src/core/integration/index.ts b/packages/db/src/core/integration/index.ts index 5c001bd46702..986b2f84c6ed 100644 --- a/packages/db/src/core/integration/index.ts +++ b/packages/db/src/core/integration/index.ts @@ -145,10 +145,17 @@ function astroDBIntegration(): AstroIntegration { seedInFlight = true; const mod = server.moduleGraph.getModuleById(resolved.seedVirtual); if (mod) server.moduleGraph.invalidateModule(mod); - server.ssrLoadModule(resolved.seedVirtual).then(() => { - seedInFlight = false; - logger.info('Seeded database.'); - }); + server + .ssrLoadModule(resolved.seedVirtual) + .then(() => { + logger.info('Seeded database.'); + }) + .catch((e) => { + logger.error(e instanceof Error ? e.message : String(e)); + }) + .finally(() => { + seedInFlight = false; + }); } }, 100); },