Error in canister function call using actor

Hi all, I want to call the backend canister function using actor in my react application. I have created the actor and it goes like this when console logged


But when I use that actor to call the function, it shows me an error like this…


Have I done anything wrong out here! What’s the issue?

Note: Important thing I note in the error log is the msg part,

"Message": "IC0302: Canister rdmx6-jaaaa-aaaaa-aaadq-cai has no query method 'allPosts'"

Here the canister ID is not the backend canister ID, but the frontend canister ID.

Since you say the error message displays the wrong canister ID: Can you show how you create the actor?

Other, completely wild guess: the error message says there is no query method allPosts. Is it by chance not marked as a query so you’d have to call it as an update call?

1 Like

Hi Severin, Thanks for the reply… It is a minor mistake. My code imported the frontend canisterId rather than the backend. :sweat_smile: