From 90abeedc446e1cf5e704a233304f0652f2dddfb4 Mon Sep 17 00:00:00 2001 From: alvrs Date: Sun, 24 Sep 2023 12:18:43 +0100 Subject: [PATCH] fix(common): always import relative sol files from ./ --- packages/common/src/codegen/utils/loadUserTypesFile.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/common/src/codegen/utils/loadUserTypesFile.ts b/packages/common/src/codegen/utils/loadUserTypesFile.ts index 2a5394e483..8573e8c165 100644 --- a/packages/common/src/codegen/utils/loadUserTypesFile.ts +++ b/packages/common/src/codegen/utils/loadUserTypesFile.ts @@ -31,8 +31,9 @@ function loadUserTypesFile( data: string; } { if (unresolvedFilePath.at(0) === ".") { + const relativePath = path.relative(outputBaseDirectory, unresolvedFilePath); return { - filePath: path.relative(outputBaseDirectory, unresolvedFilePath), + filePath: "./" + relativePath, // solc doesn't like relative paths without "./" data: readFileSync(unresolvedFilePath, "utf8"), }; } else {