Skip to content

Lesson 13: Weird error with @useDapp #333

Answered by cromewar
cromewar asked this question in Q&A
Discussion options

You must be logged in to vote

Solution:

Patrick had the exact same problem on this video for chainlink's hackathon, seeing the video I noticed the problem vscode was mainly complaining about two instances of node_modules between @usedapp and @ethersproject/contracts.

It seems @usedapp already comes with a implementation of ethersproject inside of it, so I found the solution.

Replace this line:

import {Contract} from '@ethersproject/contracts'

For this line:

import {Contract} from '@usedapp/core/node_modules/@ethersproject/contracts'

and eureka, the problem is solved ;)

Thanks @PatrickAlphaC if it wasn't for the video I would never have noticed the error.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@PatrickAlphaC
Comment options

@cromewar
Comment options

@NarithChesda
Comment options

Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants