Skip to content

Commit

Permalink
Merge pull request #5918 from NomicFoundation/fix-hardhat-package-res…
Browse files Browse the repository at this point in the history
…olution

Fix hardhat package resolution
  • Loading branch information
alcuadrado authored Nov 1, 2024
2 parents 906f9b6 + c8d2623 commit 9cbc645
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
getFileTrueCase,
readJsonFile,
readUtf8File,
getRealPath,
} from "@ignored/hardhat-vnext-utils/fs";
import { findClosestPackageJson } from "@ignored/hardhat-vnext-utils/package";
import { shortenPath } from "@ignored/hardhat-vnext-utils/path";
import { ResolutionError, resolve } from "@ignored/hardhat-vnext-utils/resolve";
import { analyze } from "@nomicfoundation/solidity-analyzer";
Expand Down Expand Up @@ -1085,12 +1085,7 @@ export class ResolverImplementation implements Resolver {
packageName === "hardhat"
? ({
success: true,
absolutePath: await getRealPath(
path.resolve(
import.meta.dirname,
"../../../../../../package.json",
),
),
absolutePath: await findClosestPackageJson(import.meta.dirname),
} as const)
: resolve(packageName + "/package.json", baseResolutionDirectory);

Expand Down

0 comments on commit 9cbc645

Please sign in to comment.