From 348c71ecdc7e2a7afb169c2251692416d5e59fcb Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 4 Dec 2024 15:04:06 +0000 Subject: [PATCH] fix(db): import base virtual module ID (#12628) --- .changeset/red-emus-repair.md | 5 +++++ packages/db/src/core/integration/index.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/red-emus-repair.md diff --git a/.changeset/red-emus-repair.md b/.changeset/red-emus-repair.md new file mode 100644 index 0000000000..e0dbf68d9a --- /dev/null +++ b/.changeset/red-emus-repair.md @@ -0,0 +1,5 @@ +--- +'@astrojs/db': patch +--- + +Fixes a bug that caused an error to be logged about invalid entrypoints diff --git a/packages/db/src/core/integration/index.ts b/packages/db/src/core/integration/index.ts index b96765870b..200c7ddc25 100644 --- a/packages/db/src/core/integration/index.ts +++ b/packages/db/src/core/integration/index.ts @@ -16,7 +16,7 @@ import { } from 'vite'; import parseArgs from 'yargs-parser'; import { AstroDbError } from '../../runtime/utils.js'; -import { CONFIG_FILE_NAMES, DB_PATH } from '../consts.js'; +import { CONFIG_FILE_NAMES, DB_PATH, VIRTUAL_MODULE_ID } from '../consts.js'; import { EXEC_DEFAULT_EXPORT_ERROR, EXEC_ERROR } from '../errors.js'; import { resolveDbConfig } from '../load-file.js'; import { SEED_DEV_FILE_NAME } from '../queries.js'; @@ -153,7 +153,7 @@ function astroDBIntegration(): AstroIntegration { ); // Eager load astro:db module on startup if (seedFiles.get().length || localSeedPaths.find((path) => existsSync(path))) { - server.ssrLoadModule(resolved.module).catch((e) => { + server.ssrLoadModule(VIRTUAL_MODULE_ID).catch((e) => { logger.error(e instanceof Error ? e.message : String(e)); }); }