0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fix(db): import base virtual module ID (#12628)

This commit is contained in:
Matt Kane 2024-12-04 15:04:06 +00:00 committed by GitHub
parent 24edead67a
commit 348c71ecdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/db': patch
---
Fixes a bug that caused an error to be logged about invalid entrypoints

View file

@ -16,7 +16,7 @@ import {
} from 'vite'; } from 'vite';
import parseArgs from 'yargs-parser'; import parseArgs from 'yargs-parser';
import { AstroDbError } from '../../runtime/utils.js'; 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 { EXEC_DEFAULT_EXPORT_ERROR, EXEC_ERROR } from '../errors.js';
import { resolveDbConfig } from '../load-file.js'; import { resolveDbConfig } from '../load-file.js';
import { SEED_DEV_FILE_NAME } from '../queries.js'; import { SEED_DEV_FILE_NAME } from '../queries.js';
@ -153,7 +153,7 @@ function astroDBIntegration(): AstroIntegration {
); );
// Eager load astro:db module on startup // Eager load astro:db module on startup
if (seedFiles.get().length || localSeedPaths.find((path) => existsSync(path))) { 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)); logger.error(e instanceof Error ? e.message : String(e));
}); });
} }