Type 'undefined' cannot be used as an index type #1363
Replies: 2 comments 4 replies
-
Hello there @Kuchy300 |
Beta Was this translation helpful? Give feedback.
-
Hello @NarithChesda I know it is pretty old issue but it's still unanswered, so solution for you @NarithChesda is that you have networkMapping[chainId]["DappToken"][0] : constants.AddressZero instead of networkMapping[stringChainId]["DappToken"][0] : constants.AddressZero @cromewar unfortunately I do not have screens from my index incorrect type error, but do you have any idea why that error might occur? I have just updated Main.tsx by adding |
Beta Was this translation helpful? Give feedback.
-
What's wrong with this?
It was working just fine, but then it became error... anybody having the same problem?
now I just assign index directly to the networkMapping[ ] to get it working.
noted : I'm doing front-end separately from the contract folder, I just copy the deployment and contract folder from build to src in my front-end project.
Main.tsx
This is my map.json
my package.json
it was working fine when I followed along with the tutorial, but I was having trouble with @usedapp/[email protected] as useTokenBalance and useContractCall always return undefined, so I upgrade @usedapp/core to @0.12.2(latest) and it fixed that problem but it came with this new problem.
Beta Was this translation helpful? Give feedback.
All reactions