Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body

My canister used to work normal with an update call, but yesterday some how it return this error. I did change some code but not relate to this function and also all other update calls work correctly. The update called is success based on the logs, but in client side it always behavior like this
Even I tried force return a Ok(MockReturn) it will success but after change canister’s code back it still got this error.

What are the changes you make that break the code? Can you show us your code? To me this looks more like a JS issue…

I found a way to fix it but don’t know why it behavior like this, it used to work before

My code used useAgent from IdentityKit
now I changed to this code

import { useIdentity } from "@nfid/identitykit/react";

 const identity = useIdentity();
  const agent = HttpAgent.createSync({
      host: DEFAULT_ICP_URL,
      identity: identity,
  });

1 Like

I just used your solution to fix the same error that I encountered and it has worked very well. :+1: :+1:

seems we encounter some same error, can you share me your dependencies version. I’m helping IdentityKit team re-produce this issue

I was facing the issue here with identityKit 1.0.1. I then updated the version to 1.0.2 and thats when i faced the issue here. I was also using the agent from useAgent hook. But now, everything is running smoothly after implementing your solution

1 Like