From 35fe970b8d69335b6943ccf4ad7dd28d4f4ada38 Mon Sep 17 00:00:00 2001 From: Jonathan Cammisuli Date: Mon, 7 Feb 2022 09:50:57 -0500 Subject: [PATCH] fix: remove `file:\\` when trying to read files with yarn's crossFs (#1244) --- libs/server/src/lib/utils/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/server/src/lib/utils/utils.ts b/libs/server/src/lib/utils/utils.ts index d5361c97c1..16b9c84146 100644 --- a/libs/server/src/lib/utils/utils.ts +++ b/libs/server/src/lib/utils/utils.ts @@ -150,7 +150,10 @@ export async function readAndCacheJsonFile( json: {}, }; } - const fullFilePath = path.join(basedir, filePath); + let fullFilePath = path.join(basedir, filePath); + if (fullFilePath.startsWith('file:\\')) { + fullFilePath = fullFilePath.replace('file:\\', ''); + } try { const stats = await crossFs.statPromise(fullFilePath); if (fileContents[fullFilePath] || stats.isFile()) {