JSON client unable to set req.body on iOS/Mac Safari


I’m having an issue using the JsonServiceClient in servicestack-client in a Vue app, but ONLY on Safari on Mac/iOs.

The following error is appearing:
[Error] TypeError: Attempted to assign to readonly property.

When I look into the code the problem is in the createRequest method, line 2 below - so req.body can not be assigned to:

if (HttpMethods.hasRequestBody(method))
req.body = body || JSON.stringify(request);
var opt = { url: url };
if (this.requestFilter != null)
this.requestFilter(req, opt);
return [req, opt];

Has anyone else had this issue or been able to resolve it?

This looks like an old version of @servicestack/client, can you upgrade to the latest 1.0.31.

Yes - my bad - it appears I installed as ‘servicestack-client’ instead of ‘@servicestack/client’.
I will try this and hopefully the problem goes away.