-
Notifications
You must be signed in to change notification settings - Fork 140
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
Cannot export local transaction to tenderly using cli #108
Comments
I have the same issue here, it seems that hardhat use I tried downgrading the hardhat but it failed with another error, as I'm using the
|
+1 Same issue, but using yarn workspaces in a monorepo. Tenderly Current CLI version: v1.4.7
|
same error |
Same issue here |
Quick fix for those interested. |
I had the same issue as well: [eval]:20
var jsonConfig = JSON.stringify(config, (key, value) => {
^
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at [eval]:20:25
at Script.runInThisContext (node:vm:129:12)
at Object.runInThisContext (node:vm:305:38)
at node:internal/process/execution:75:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:74:60)
at node:internal/main/eval_string:27:3
aaand 👍 ✅ , fixed the issue after adding it: BigInt.prototype.toJSON = function() { return this.toString() } to ./node_modules/hardhat/internal/context.js your context.js could look like this "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HardhatContext = void 0;
const extenders_1 = require("./core/config/extenders");
const errors_1 = require("./core/errors");
const errors_list_1 = require("./core/errors-list");
const dsl_1 = require("./core/tasks/dsl");
const platform_1 = require("./util/platform");
class HardhatContext {
constructor() {
this.tasksDSL = new dsl_1.TasksDSL();
this.extendersManager = new extenders_1.ExtenderManager();
this.configExtenders = [];
// NOTE: This is experimental and will be removed. Please contact our team if
// you are planning to use it.
this.experimentalHardhatNetworkMessageTraceHooks = [];
}
static isCreated() {
const globalWithHardhatContext = global;
return globalWithHardhatContext.__hardhatContext !== undefined;
}
static createHardhatContext() {
if (this.isCreated()) {
throw new errors_1.HardhatError(errors_list_1.ERRORS.GENERAL.CONTEXT_ALREADY_CREATED);
}
const globalWithHardhatContext = global;
const ctx = new HardhatContext();
globalWithHardhatContext.__hardhatContext = ctx;
return ctx;
}
static getHardhatContext() {
const globalWithHardhatContext = global;
const ctx = globalWithHardhatContext.__hardhatContext;
// where the magic happens
BigInt.prototype.toJSON = function() { return this.toString() }
if (ctx === undefined) {
throw new errors_1.HardhatError(errors_list_1.ERRORS.GENERAL.CONTEXT_NOT_CREATED);
}
return ctx;
}
static deleteHardhatContext() {
const globalAsAny = global;
globalAsAny.__hardhatContext = undefined;
}
setHardhatRuntimeEnvironment(env) {
if (this.environment !== undefined) {
throw new errors_1.HardhatError(errors_list_1.ERRORS.GENERAL.CONTEXT_HRE_ALREADY_DEFINED);
}
this.environment = env;
}
getHardhatRuntimeEnvironment() {
if (this.environment === undefined) {
throw new errors_1.HardhatError(errors_list_1.ERRORS.GENERAL.CONTEXT_HRE_NOT_DEFINED);
}
return this.environment;
}
setConfigLoadingAsStarted() {
this._filesLoadedBeforeConfig = (0, platform_1.getRequireCachedFiles)();
}
setConfigLoadingAsFinished() {
this._filesLoadedAfterConfig = (0, platform_1.getRequireCachedFiles)();
}
getFilesLoadedDuringConfig() {
// No config was loaded
if (this._filesLoadedBeforeConfig === undefined) {
return [];
}
(0, errors_1.assertHardhatInvariant)(this._filesLoadedAfterConfig !== undefined, "Config loading was set as started and not finished");
return arraysDifference(this._filesLoadedAfterConfig, this._filesLoadedBeforeConfig);
}
}
exports.HardhatContext = HardhatContext;
function arraysDifference(a, b) {
return a.filter((e) => !b.includes(e));
}
//# sourceMappingURL=context.js.map then just run thx @Fr3d- |
@Fr3d- I have a better idea - Add that into |
Tenderly Current CLI version: v1.4.7
Hardhat Version: 2.12.2
Compiler version: 0.8.15
Trying to export a local transaction. It used to work bu not anymore.
The export fails with the following error message:
Couldn't read Hardhat config file
:When I debug it there is this error:
Let me know if you need anything else
Edit: With 2.8.0 hardhat it works just fine not sure where the problem is
The text was updated successfully, but these errors were encountered: