2
  • servicestack-client version 1.0.9
  • Microsoft Edge 38.14393.2068.0
  • Microsoft EdgeHTML 14.14393

I am getting the following Javascript error in Microsoft Edge 38.14393.2068.0:

"Object doesn't support property or method 'json'"

enter image description here

I suspecting that this Microsoft Edge Javascript error is coming from the ServiceStack Typescript JsonServiceClient, you can find this npm package's source code is here

Use the standalone app below to reproduce this issue in MS Edge:

You will see Chrome works fine but MS Edge fails with the "Object doesn't support property or method 'json'" error.

If there is a valid bearerToken, both MS EDGE and Chrome requests work.

Brian Ogden
  • 18,439
  • 10
  • 97
  • 176

1 Answers1

2

I can't reproduce this exact error but I've found an issue with MS Edge where it throws a DOMException when calling W3C fetch's .json() API on an empty JSON response which is resolved in this commit. This fix is available from v0.0.41 of servicestack-client that's now available on npm.

If this doesn't solve your issue, please create a small stand-alone example which we can run that repro's the issue.

mythz
  • 141,670
  • 29
  • 246
  • 390
  • I only see this error localhost if that is any kind of clue for you – Brian Ogden Apr 12 '18 at 22:28
  • ok I have updated my question with a working server link you can test in Chrome and Edge and the code with my JsonServiceClient request, let me know if you still need a full stand alone app for this issue, I am using service-stack version 1.0.9 – Brian Ogden Apr 19 '18 at 00:25
  • I just added credentials so you can login to my app and test this issue, all instructions on in my question for you – Brian Ogden Apr 19 '18 at 00:53
  • @BrianOgden I have no idea what I'm looking for, I'm not seeing any [JavaScript Errors in MS Edge](https://imgur.com/a/zSpED). Either way I can't be debugging through hoops like this. I need to be able to reproduce the issue in isolation. If you're going to send an external site, have it link to an external service like http://plnkr.co or http://jsbin.com where it just contains the minimal source code to reproduce the issue. – mythz Apr 19 '18 at 01:02
  • I have added a standalone application that reproduces this error in MS Edge for you to test, see my question for instructions to clone and run, thanks – Brian Ogden Apr 19 '18 at 23:13
  • @BrianOgden There is [no JavaScript error in MS Edge](https://imgur.com/a/hY645Ym). It's behaving the same as Chrome. – mythz Apr 19 '18 at 23:30
  • perhaps we are talking about the version of MS Edge than, you do not see "Object doesn't support property or method 'json'"? What version of MS Edge are you testing? – Brian Ogden Apr 20 '18 at 04:09
  • I guarantee you that my version of MS Edge is failing – Brian Ogden Apr 20 '18 at 04:10
  • @BrianOgden I see what's in the linked screenshot - no JS Errors. My Version (on Win10): Microsoft Edge 41.16299.371.0. If it's failing it's a bug with that version of MS Edge. – mythz Apr 20 '18 at 04:13
  • Thanks Mythz,ya it is Microsoft Edge 38.14393.2068.0 that this bug is occurring in,I updated my question with the MS Edge version. – Brian Ogden Apr 20 '18 at 17:49
  • is there any possible patch for this?, I have a client with 9,000 employees and all machines have a Windows 10 build with Microsoft Edge 38 – Brian Ogden Jul 12 '18 at 18:04
  • @BrianOgden We’ll accept PR’s but supporting an old buggy version of Edge is not a priority or being considered – mythz Jul 12 '18 at 18:22
  • any guidance on getting the servicestack-client "working localhost" I currently just use the npm package – Brian Ogden Jul 12 '18 at 18:59
  • @BrianOgden Clone the [servicestack-client](https://github.com/ServiceStack/servicestack-client) repo, run a static web server like [http-server](https://www.npmjs.com/package/http-server) on the command-line where you can then run `testrunner.html` to run tests in the browser. Otherwise you can just reference the compiled [src/index.js](https://github.com/ServiceStack/servicestack-client/blob/master/src/index.js) in a web page. It's a standard TypeScript project so running `tsc` or a command that depends on it like `npm test` will recompile any changes made to the original `.ts` source files – mythz Jul 12 '18 at 19:05