I had a similar issue but I am not sure that it is related exactly.
I am not sure why but it appears that my issue had something to do with how the query parameters were being interpreted. The fix for me was to encode the params with encodeURIComponent().
This appears to resolve my issue but I am not sure that it will help with yours. I had one parameter set to a JSON string. Encoding it stopped me from getting this exception.
Cheers!