jaiv
jaiv2y ago

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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
jaiv
jaiv2y ago
i'll send more info tomorrow
jaiv
jaiv2y ago
@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
jaiv
jaiv2y ago
it seems like the "u" in the json error is referring to undefined somewhere, but the payload is sending correctly
jaiv
jaiv2y ago
the links and transformer
jaiv
jaiv2y ago
i had a middleware that was assuming requests were queries and parsing the input json. that caused issues when using mutations