Cannot Call Update Function on New Mainnet Canister Post icp0.io Using @dfinity/agent v 0.15.6

I’ve recently added a new canister on mainnet as well as updated all of my @dfinity js libraries to latest (0.15.6), but when I try to call an update method on said canister I get the following error.

Here is the code that is erroring out: https://github.com/dfinity/agent-js/blob/main/packages/agent/src/certificate.ts#L205

I added some logs in my node modules and it looks like there is a valid canister id and set of principals in the context of the code. Also, it’s notable that I don’t have any issues when running this code against canisters in my local replica.

Has anyone seen this issue before?

Have you try to downgrade agent-js from a version less recent than < v0.15.6?

I rolled back to the last version I had before upgrading, which was 0.13.3 and it worked. Will do more testing and try to identify which version actually has the bug so I can report it.

1 Like

I would suggest using lerna or a similar software for independent versioning of all of the agent-js packages. If y’all only update one of them in a PR there’s no need to update the versions of every one of the packages. This isn’t too tough and I am happy to help with that if desired.

It would be really useful if you could find in which version the issue surfaces. That would help debugging the problem a lot.

I think Lerna is deprecated. We using npm workspaces in agent-js and ic-js. While I don’t have the references readily available, it was decided not to provide agent-js as a single bundle. Instead, they opted for split packages to offer developers more flexibility and the ability to reduce bundle sizes as needed.

So Lerna was deprecated but not anymore. Some company took it on and they just released version 7, which works really well for us.

In regards to how the packages are split up, I think there’s a misunderstanding here. I’m a fan of having each package as its own bundle and that’s ideal. After doing some more digging I think there’s some topographic versioning of the packages and that explains why a lot of the packages have new versions even when their source code doesn’t change.

Anyway, thanks for the tip. i should have tried that earlier but I am trying to use the latest versions of deps to keep things up to date. I’ll report back soon

Good to know about Lerna, did not knew about last development. Thanks for the feedback and looking forward to the outcome of your experiments!

I’m still seeing that same error, and am even now seeing this error below

Even though you downgraded to agent-js v0.13.3?

Yes, that created the last error I just posted. When I bump up to 0.15.0 it works locally against mainnet but not in a deployed UI.

Ok thanks for the clarification. I’ll forward the information to the team.

This has been solved. It was an issue of conflicting, nested dependencies for @dfinity/principal.

1 Like