Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error HH10: Error while loading Hardhat's configuration. #48

Open
mhxw opened this issue May 24, 2023 · 10 comments
Open

Error HH10: Error while loading Hardhat's configuration. #48

mhxw opened this issue May 24, 2023 · 10 comments

Comments

@mhxw
Copy link

mhxw commented May 24, 2023

Error HH10: Error while loading Hardhat's configuration.
You or one of your plugins is trying to modify the userConfig.tracer.nameTags

@zemse
Copy link
Owner

zemse commented May 25, 2023

Is your repo public? Is the problem reproducible using the latest v2.3.2?

@XWJACK
Copy link

XWJACK commented Jun 2, 2023

same question

diff --git a/node_modules/hardhat-tracer/dist/src/format/call.js b/node_modules/hardhat-tracer/dist/src/format/call.js
index 11dc7b5..f2ec5f8 100644
--- a/node_modules/hardhat-tracer/dist/src/format/call.js
+++ b/node_modules/hardhat-tracer/dist/src/format/call.js
@@ -32,7 +32,7 @@ async function formatCall(to, input, ret, value, gasUsed, gasLimit, success, dep
             contractName = betterContractName;
         }
         else if (contractName) {
-            dependencies.tracerEnv.nameTags[to] = contractName;
+            // dependencies.tracerEnv.nameTags[to] = contractName;
         }
     }
     // if ERC20 method found then fetch decimals
@@ -77,9 +77,9 @@ async function formatCall(to, input, ret, value, gasUsed, gasLimit, success, dep
         const outputArgs = returnResult
             ? (0, result_1.formatResult)(returnResult, fragment.outputs, { decimals: contractDecimals, shorten: true }, dependencies)
             : // if return data is not decoded, then show return data only if call was success
-                ret !== "0x" && success !== false // success can be undefined
-                    ? ret
-                    : "";
+            ret !== "0x" && success !== false // success can be undefined
+                ? ret
+                : "";
         const nameToPrint = contractName ?? "UnknownContract";
         return `${to &&
             (dependencies.tracerEnv.showAddresses ||
diff --git a/node_modules/hardhat-tracer/dist/src/utils/metadata.js b/node_modules/hardhat-tracer/dist/src/utils/metadata.js
index 6a95388..2a19a2b 100644
--- a/node_modules/hardhat-tracer/dist/src/utils/metadata.js
+++ b/node_modules/hardhat-tracer/dist/src/utils/metadata.js
@@ -107,13 +107,13 @@ async function getBetterContractName(address, dependencies) {
     const contractNameFromNameMethod = await fetchContractName(address, dependencies);
     dependencies.tracerEnv.enabled = true; // enable tracer back
     if (contractNameFromNameMethod) {
-        dependencies.tracerEnv.nameTags[address] = contractNameFromNameMethod;
+        // dependencies.tracerEnv.nameTags[address] = contractNameFromNameMethod;
         return contractNameFromNameMethod;
     }
     // 3. Match bytecode
     const contractNameFromBytecodeComparison = await fetchContractNameUsingBytecodeComparison(address, dependencies);
     if (contractNameFromBytecodeComparison) {
-        dependencies.tracerEnv.nameTags[address] = contractNameFromBytecodeComparison;
+        // dependencies.tracerEnv.nameTags[address] = contractNameFromBytecodeComparison;
         return contractNameFromBytecodeComparison;
     }
 }

hardhat-tracer+2.3.2.patch

@zemse
Copy link
Owner

zemse commented Jun 3, 2023

I'm looking into this problem, the code should not have modified the userConfig at all, but if the error says so then that's a bug. Just to confirm, after applying this diff did the HH10 error go away for you?

@zemse
Copy link
Owner

zemse commented Jun 3, 2023

Can you try [email protected] if it fixes this problem?

@XWJACK
Copy link

XWJACK commented Jun 3, 2023

new error

DOMException [DataCloneError]: #<Object> could not be cloned.
    at new DOMException (node:internal/per_context/domexception:53:5)
    at structuredClone (node:internal/structured_clone:23:17)
    at /node_modules/@ungap/structured-clone/cjs/index.js:21:46
    at /node_modules/hardhat-tracer/src/extend/config.ts:22:39

@zemse
Copy link
Owner

zemse commented Jun 4, 2023

can you share your config passed for tracer: {} in the hardhat.config.ts file?

@XWJACK
Copy link

XWJACK commented Jun 5, 2023

tracer: {
        opcodes: [
            'CALL',
            'STATICCALL',
            'DELEGATECALL',
            'REVERT',
        ],
        showAddresses: true,
        enableAllOpcodes: false,
        gasCost: true,
        nameTags: {
            '0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC': 'Seaport 1.5',
        }
}

@zemse
Copy link
Owner

zemse commented Jun 5, 2023

Thanks! I've published [email protected] with the fix. Please try it and let me know if it has any issues.

@mhxw
Copy link
Author

mhxw commented Jun 5, 2023

Thank you very much! I have tried the [email protected] version, and the fix works great. If I encounter any issues during use, I will inform you promptly. Thanks again for your help and support!

@k06a
Copy link
Contributor

k06a commented Jun 12, 2023

@XWJACK fixed in 2.3.5: #49 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants