From afa30bcaf032d986a46247efb5edc15594e49a88 Mon Sep 17 00:00:00 2001 From: Hoarfroster Date: Wed, 2 Oct 2024 00:23:01 +0800 Subject: [PATCH] enhance(build): improve expected document path error message (#11606) feat: better logging hopefully fixes #11531 --- build/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/index.ts b/build/index.ts index ccacb3b2b8ef..6623779b0ca7 100644 --- a/build/index.ts +++ b/build/index.ts @@ -200,9 +200,10 @@ export async function buildDocument( }; const { metadata, fileInfo } = document; - if (Document.urlToFolderPath(document.url) !== document.fileInfo.folder) { + const expectedFolderPath = Document.urlToFolderPath(document.url); + if (expectedFolderPath !== document.fileInfo.folder) { throw new Error( - `The document's slug (${metadata.slug}) doesn't match its disk folder name (${document.fileInfo.folder})` + `The document's slug (${metadata.slug}) doesn't match its disk folder name (${document.fileInfo.folder}): expected path (${expectedFolderPath})` ); }