From dc6064c0ea4541bfac8c32aabb9c660fbf099217 Mon Sep 17 00:00:00 2001
From: Martyanov Andrey <37772440+martyanovandrey@users.noreply.github.com>
Date: Tue, 30 Jul 2024 12:50:06 +0300
Subject: [PATCH] fix: unfoldIncludes should handle errors without path field

---
 src/transform/plugins/includes/index.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/transform/plugins/includes/index.ts b/src/transform/plugins/includes/index.ts
index fa731d19..4ab85c37 100644
--- a/src/transform/plugins/includes/index.ts
+++ b/src/transform/plugins/includes/index.ts
@@ -77,7 +77,7 @@ function unfoldIncludes(state: StateCore, path: string, options: Options) {
                 }
             } catch (e) {
                 // @ts-ignore for some reason typescript fails here
-                const errPath = e.path.replace(root, '');
+                const errPath = e.path?.replace(root, '');
 
                 if (notFoundCb) {
                     notFoundCb(errPath);