I am creating a React/Redux application using Typescript 2.1.4 and ES6 (using babel-polyfill and webpack).
I get the following error when attempting to call any API method using JsonServiceClient:
Uncaught (in promise) TypeError: Failed to fetch, thrown from line #264 (JsonServiceClient.send)
I noticed that in Fiddler it appears that the JsonServiceClient is attempting to pass its payload to http://localhost:8088/json/reply/Object , which led me to take a look at the way that I was invoking the POST.
I was creating an instance of message class like this :
which produce the following output :
if I change my code to the following :
then I get the following error :
Uncaught (in promise) TypeError: WEBPACK_IMPORTED_MODULE_3__models_go_People_dtos.GetPerson is not a constructor
I have a feeling that this might be an ES6/Typescript compatibility issue (I cannot downgrade the version of Typescript to output ES5 because I am using generator functions with redux-saga), but I am not sure how to work around it (without losing the use of the automatically generated ServiceStack dtos).
Please can you assist?
my generated DTO class looks like this (just in case) :