From abf0c5bd325de3276c9ace105d3f667bcec74cbf Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Tue, 9 Jan 2024 15:43:42 -0800 Subject: [PATCH] throw on invalid config --- src/config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 8912d9503..6011652e9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -46,7 +46,8 @@ export async function readDefaultConfig(root?: string): Promise { for (const ext of [".js", ".ts"]) { try { return await readConfig("observablehq.config" + ext, root); - } catch (error) { + } catch (error: any) { + if (error.code !== "ERR_MODULE_NOT_FOUND") throw error; continue; } }