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 {