Skip to content

Commit

Permalink
fix(db): import base virtual module ID (#12628)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Dec 4, 2024
1 parent 24edead commit 348c71e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-emus-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/db': patch
---

Fixes a bug that caused an error to be logged about invalid entrypoints
4 changes: 2 additions & 2 deletions packages/db/src/core/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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));
});
}
Expand Down

0 comments on commit 348c71e

Please sign in to comment.