Closed AnneCh closed 2 years ago
FYI, I've also tried your stackOverflow answer for a very similar problem solution and it created another error linked to the contracts :
const tokenFarmInterface: utils.Interface
Argument of type 'Interface' is not assignable to parameter of type 'ContractInterface'.
Type 'Interface' is missing the following properties from type 'Interface': decodeErrorResult, encodeErrorResult, parseErrorts(2345)
In parallel, in my StakeForm.tsx
, regardless of the import contract
statement, I have the following error on transactionName
for this function:
useEffect(() => {
if (notifications.filter(
(notification) =>
notification.type === "transactionSucceed" &&
notification.transactionName === "Approve ERC20 transfer").length > 0) {
console.log("Approved!!")
}
if (notifications.filter(
(notification) =>
notification.type === "transactionSucceed" &&
notification.transactionName === "Stake Tokens").length > 0) {
console.log("Tokens Staked!!")
}
}, [notifications])
error:
Property 'transactionName' does not exist on type '{ id: string; } & { submittedAt: number; } & { type: "transactionSucceed"; transaction: TransactionResponse; receipt: TransactionReceipt; }'.ts(2339)
Fixed it : deleting the node_modules
folder and yarn.lock
file + running yarn
again in the front_end folder did it.
In the
useStakeTokens.ts
file, I keep running into the same Typescript error message, which stops me from testing the function on the localhost.Here are the problematic declarations:
and here is the error message that I get respectively:
I'm running Typescript's latest version, 4.5.5. I've tried downgrading to previous versions, but the problem persists.
Any idea on how to fix this?