Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

ENS is not a constructor #92

Open
shaojiankui opened this issue Apr 27, 2022 · 5 comments
Open

ENS is not a constructor #92

shaojiankui opened this issue Apr 27, 2022 · 5 comments

Comments

@shaojiankui
Copy link

I am trying to get address using ens domain but when I use the below code snippet it gives me TypeError: ENS is not a constructor, have I written it in the right way?

import ENS, { getEnsAddress } from '@ensdomains/ensjs';
const provider = "https://ropsten.infura.io/v3/project_id";
const ens = new ENS({ provider, ensAddress: getEnsAddress('1') });
const name = ens.name('abcd.eth').getAddress();
name.then((str) => {
console.log(str);
});

@shaojiankui shaojiankui changed the title const ens = new ENS({ provider, ensAddress: getEnsAddress(1) }) ENS is not a constructor Apr 27, 2022
@jacko06v
Copy link

jacko06v commented Jun 3, 2022

i have the same error, did you resolve it?

@shaojiankui
Copy link
Author

shaojiankui commented Jun 6, 2022

QQ20220606-091749@2x

import { getEnsAddress,ENS } from '@ensdomains/ensjs';

Temporary modification valid,But this is in node modules

@dirichletzz
Copy link

Any update?

@jacko06v
Copy link

use ethersjs instead of ensjs, with the latest updates it has integrated almost all ensjs functions and it works perfectly

@Rotemy
Copy link

Rotemy commented Jul 28, 2022

Is it just me or the query is extremely slow... like 2 seconds to fetch ENS name of an address. Does that make sense?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants