maticjs-web3 icon indicating copy to clipboard operation
maticjs-web3 copied to clipboard

Cannot find module 'web3/eth/types' or its corresponding type declarations.

Open DavidVojnicHajduk opened this issue 2 years ago • 2 comments

File node_modules/@maticnetwork/maticjs-web3/dist/ts/utils/web3_tx_to_matic_tx.d.ts is responsible for the error, I have tried reinstalling the package and manually installing the web3 package but it didn't help.

DavidVojnicHajduk avatar Mar 23 '22 08:03 DavidVojnicHajduk

Looks like it tries to find 'Transaction' and I noticed that Transaction exists here web3-eth/types/index.d.ts (if web3 is installed) So, I changed import { Transaction } from "web3/eth/types"; line to import { Transaction } from "web3-eth/types"; (changed slash to dash) in node_modules/@maticnetwork/maticjs-web3/dist/ts/utils/web3_tx_to_matic_tx.d.ts and issue dissappeared.

AlexandrVolfson avatar Apr 24 '22 21:04 AlexandrVolfson

That's a tricky way, Is there any way to fix this issue without any changing in node_modules?

deep-quality-dev avatar May 05 '22 07:05 deep-quality-dev