SyntaxError Unexpected token u in JSON at position 0 with mutations
I'm trying to use trpc client to await a mutation and just keep getting this error. everything works if i change the mutations into queries
6 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i'll send more info tomorrow
@oscartbeaumont i went back to working on this and here is more information. this user.auth works as a query, but when switched to a mutation it breaks with these errors. i am using the client api
![](https://utfs.io/f/95fc2b8d-2129-4314-85ff-a7486b88d6ca-4pl4mu.png)
![](https://utfs.io/f/0c76c367-a92b-4992-8391-1db6730a44dd-4pl4mu.png)
![](https://utfs.io/f/d8fcc127-fea9-48e8-8666-a07937900875-4pl4mu.png)
![](https://utfs.io/f/c4371419-77b7-4eb1-85aa-69713a394e73-4pl4mu.png)
it seems like the "u" in the json error is referring to undefined somewhere, but the payload is sending correctly
![](https://utfs.io/f/b7983d6a-cf72-4c00-95b4-123824e0c21c-4pl4mu.png)
the links and transformer
![](https://utfs.io/f/ec8f6043-5f7d-4e66-97c1-5443f6980e29-4pl4mu.png)
i had a middleware that was assuming requests were queries and parsing the input json. that caused issues when using mutations