Hello everybody!
When I try to access to a canister like below, then I’m getting a type error:
TypeError: interfaceFactory is not a function
import { Actor, HttpAgent } from "@dfinity/agent";
import deployerIDL from "../../Deployer/Deployer.did";
const agent = new HttpAgent();
const deployer = Actor.createActor( // <- error shows this line
deployerIDL,
{
agent,
canisterId: "rrkah-fqaaa-aaaaa-aaaaq-cai",
}
);
In this case the question is: why it works within this repository, not works within mine repo?
wang
2
What does console.log(deployerIDL)
return?
It returns: /static/media/Deployer.93b24ad9.did
wang
4
Do you have a Deployer.did.js
file with the JS bindings? Are you using webpack?
1 Like
Yes, I have Deployer.did.js
, no I’m using @craco
I edited the end of line with .js at line 2, and it worked!