From 17badaf55c79cec460c74f4da58bf188eedef7e3 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 1 Apr 2024 14:18:46 -0400 Subject: [PATCH] Give proper error when seed missing default export (#10635) --- .changeset/tidy-dancers-itch.md | 5 +++++ packages/db/src/core/cli/commands/execute/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tidy-dancers-itch.md diff --git a/.changeset/tidy-dancers-itch.md b/.changeset/tidy-dancers-itch.md new file mode 100644 index 0000000000..56ee8ed631 --- /dev/null +++ b/.changeset/tidy-dancers-itch.md @@ -0,0 +1,5 @@ +--- +"@astrojs/db": patch +--- + +Give proper error when seed missing default export diff --git a/packages/db/src/core/cli/commands/execute/index.ts b/packages/db/src/core/cli/commands/execute/index.ts index eb51467d96..44a2c44fd6 100644 --- a/packages/db/src/core/cli/commands/execute/index.ts +++ b/packages/db/src/core/cli/commands/execute/index.ts @@ -58,7 +58,7 @@ export async function cmd({ const mod = await importBundledFile({ code, root: astroConfig.root }); if (typeof mod.default !== 'function') { - console.error(EXEC_DEFAULT_EXPORT_ERROR); + console.error(EXEC_DEFAULT_EXPORT_ERROR(filePath)); process.exit(1); } try {