Property 'deploy' in type 'Greeter__factory' is not assignable to the same property in base type 'ContractFactory'.
Closed this issue · 0 comments
z-br commented
Just starting with a brand new project, using JS (not typescript) and am hitting this problem when running yarn start
:
TypeScript error in /frontend/src/hardhat/typechain/factories/Greeter__factory.ts(16,3):
Property 'deploy' in type 'Greeter__factory' is not assignable to the same property in base type 'ContractFactory'.
Type '(_greeting: string, overrides?: Overrides | undefined) => Promise<Greeter>' is not assignable to type '(...args: any[]) => Promise<Contract>'.
Type 'Promise<Greeter>' is not assignable to type 'Promise<Contract>'.
Type 'Greeter' is not assignable to type 'Contract'.
The types returned by 'queryFilter(...)' are incompatible between these types.
Type 'Promise<TypedEvent<unknown>[]>' is not assignable to type 'Promise<Event[]>'.
Type 'TypedEvent<unknown>[]' is not assignable to type 'Event[]'.
Type 'TypedEvent<unknown>' is not assignable to type 'Event'.
Types of property 'args' are incompatible.
Type 'unknown' is not assignable to type 'Result | undefined'.
Type 'unknown' is not assignable to type 'Result'. TS2416
here is how I installed:
nvm use 16
npm install --save-dev @symfoni/hardhat-react
npm install --save-dev hardhat hardhat-deploy hardhat-deploy-ethers hardhat-typechain hardhat-typechain ts-morph ts-node typescript ts-generator typechain typechain-target-ethers-v5
npx hardhat // (chose advanced project, javascript)
// added all the reqs to hardhat.config.js
npx create-react-app frontend
npx hardhat react
npx hardhat node --watch&
cd frontend
nvm use 16
npm install --save ethers web3modal
npm i --save-dev @types/react
yarn start