# Unexpected end of JSON when source map disabled

**URL:** <https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264>\
**Category:** Web\
**Created:** [May 27, 2020, 3:50pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264 "2020-05-27T15:50:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![grahaampeterson](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@grahaampeterson](https://devforum.zoom.us/u/grahaampeterson)\
**Post date:** [May 27, 2020, 3:50pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/1 "2020-05-27T15:50:54Z")

</div>

Hi team @ Zoom

I’m able to instantiate the web sdk (1.7.8) locally successfully, using webpack having enabled source map ([webpack devtool documentation](https://webpack.js.org/configuration/devtool/) _‘eval-source-map’_),

I’ve noticed disabling source map in webpack caused my front end application to throw the following error

 ![unexpected end of json input](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/d/dd8c6c4b203841f1cb4055229d7948b0441a10bb.png)

Are you able to confirm this?  
Is there a solution that doesn’t require the need to ship source maps?  
Thank you

Just for reference, i’ll list what my front end application contains

**package.json**

```
"dependencies": {
    ...
    "@zoomus/websdk": "^1.7.8",
    ...
    "jquery": "^3.4.1",  
    "lodash": "^4.17.10",
    "react": "16.8.6",
    "react-dom": "16.8.6",
    "react-redux": "7.1.0",
    "redux": "3.7.2",
    "redux-thunk": "2.2.0",
}

```

**webpack.build.js**

```
module.exports = {
  devtool: PRD ? false : 'eval-source-map',
  ...
  plugins: [
    ...
  ]
}; 

```

**angular component**

```
import { Component } from '@angular/core';
import { ZoomMtg } from '@zoomus/websdk';

@Component(...)
export class ZoomComponent {
  constructor(...) {
    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();
  }
}
```

---

<div class="post-metadata">

**Author:** ![avand](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/avand/32/9363_2.png) [@avand](https://devforum.zoom.us/u/avand)\
**Post date:** [May 28, 2020, 1:31am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/2 "2020-05-28T01:31:34Z")

</div>

We’re seeing the same issue on our end. The SDK throws an unhandled exception and when we debug locally we see the correct value for the return of function `r` but when we deploy to production, we get the error because `r` returns an empty array:

 ![image (2)](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/d/d2803aaf62e50b4d08fa8de5f5d6186633f92cf4.png)

---

<div class="post-metadata">

**Author:** ![spandit](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/spandit/32/1518_2.png) [@spandit](https://devforum.zoom.us/u/spandit)\
**Post date:** [June 2, 2020, 3:10am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/3 "2020-06-02T03:10:18Z")

</div>

Hi @avand@grahaampeterson were you able to find solution for this issue ?

---

<div class="post-metadata">

**Author:** ![grahaampeterson](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@grahaampeterson](https://devforum.zoom.us/u/grahaampeterson)\
**Post date:** [June 2, 2020, 9:29am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/4 "2020-06-02T09:29:39Z")

</div>

Hi @spandit, unfortunately not at the moment, i’ve kept source map for the time being but a little concerned this will be publicly exposed

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 2, 2020, 6:41pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/5 "2020-06-02T18:41:48Z")

</div>

Hey @spandit, @grahaampeterson, @avand,

Looks like you all are using Angular, please see the Angular Sample app and how I am including the files:

> **[zoom/websdk-sample-angular](https://github.com/zoom/websdk-sample-angular)**
>
> Use the Zoom Web SDK in an Angular App. Contribute to zoom/websdk-sample-angular development by creating an account on GitHub.

> <https://github.com/zoom/websdk-sample-angular/blob/master/angular.json#L24>

Let me know if that helps!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![lucille.hua](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lucille.hua/32/9715_2.png) [@lucille.hua](https://devforum.zoom.us/u/lucille.hua)\
**Post date:** [June 2, 2020, 6:46pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/6 "2020-06-02T18:46:03Z")

</div>

Hi @tommy

We are using React with `react-scripts` build scripts. If there is no React example on how to fix it, can you explain what you are trying to do in the angular case?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 3, 2020, 10:15pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/7 "2020-06-03T22:15:21Z")

</div>

Hey @lucille.hua,

Have you included the required files? It should also work in React:

> **[@zoomus/websdk](https://www.npmjs.com/package/@zoomus/websdk#usage)**
>
> Zoom Web SDK

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![perseus362434](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/perseus362434/32/10243_2.png) [@perseus362434](https://devforum.zoom.us/u/perseus362434)\
**Post date:** [June 10, 2020, 1:04pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/8 "2020-06-10T13:04:15Z")

</div>

I faced same problem but not fixed yet.  
Please help me

---

<div class="post-metadata">

**Author:** ![prantikde](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prantikde/32/10348_2.png) [@prantikde](https://devforum.zoom.us/u/prantikde)\
**Post date:** [June 11, 2020, 7:43pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/9 "2020-06-11T19:43:41Z")

</div>

We are also facing the same exact problem with the exact same error in production.  
Can you please help me.

We are using React with `react-scripts` build scripts.  
React-version: `16.0.0`  
zoom-version: `1.7.8`

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 16, 2020, 3:27am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/11 "2020-06-16T03:27:51Z")

</div>

Hey @prantikde, @perseus362434,

Can you please provide a github repo with the error so I can reproduce and debug locally?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![prantikde](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prantikde/32/10348_2.png) [@prantikde](https://devforum.zoom.us/u/prantikde)\
**Post date:** [June 16, 2020, 10:18am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/12 "2020-06-16T10:18:42Z")

</div>

Hi @tommy

Here, is the github repo for a react app where I have replicated the error if you follow the readme file.  
[My github repo](https://github.com/deprantik/sample-zoom-web-sdk-app)

 ![Screenshot 2020-06-16 at 3.33.33 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/a/a963d4cacc1f886248b5904c4e7dec9ab050fe5c.png)

Thanks,  
Prantik

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 19, 2020, 12:35am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/14 "2020-06-19T00:35:23Z")

</div>

Hey @prantikde,

I was able to reproduce the issue using your repo, however, I was not able to solve it. This seems to be an issue with react or the way it optimizes it’s build.

Like @grahaampeterson said, it works when enabling source maps.

Maybe this Stack Overflow will help:

> <https://stackoverflow.com/questions/43841807/how-to-enable-source-maps-in-create-react-app>

> [@avand](#):
>
> We’re seeing the same issue on our end. The SDK throws an unhandled exception and when we debug locally we see the correct value for the return of function `r` but when we deploy to production, we get the error because `r` returns an empty array:

I will talk to our Web SDK engineerings to see if this is the reason it is not working in a production build. (CS-1971)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![prantikde](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prantikde/32/10348_2.png) [@prantikde](https://devforum.zoom.us/u/prantikde)\
**Post date:** [June 19, 2020, 8:07am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/15 "2020-06-19T08:07:58Z")

</div>

Hey @tommy

Thanks for checking it out.  
I hope it gets solved soon 😬

Thanks,  
Prantik

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [June 19, 2020, 10:23pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/17 "2020-06-19T22:23:36Z")

</div>

Happy to help! 🙂

I will keep you updated!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![eleal](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@eleal](https://devforum.zoom.us/u/eleal)\
**Post date:** [July 17, 2020, 2:45pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/18 "2020-07-17T14:45:09Z")

</div>

Any update about this issue?

---

<div class="post-metadata">

**Author:** ![muhamadangga609](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/muhamadangga609/32/5880_2.png) [@muhamadangga609](https://devforum.zoom.us/u/muhamadangga609)\
**Post date:** [July 20, 2020, 4:10am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/19 "2020-07-20T04:10:37Z")

</div>

waiting update for this issue

---

<div class="post-metadata">

**Author:** ![muhamadangga609](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/muhamadangga609/32/5880_2.png) [@muhamadangga609](https://devforum.zoom.us/u/muhamadangga609)\
**Post date:** [July 20, 2020, 6:40am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/20 "2020-07-20T06:40:02Z")

</div>

i use react-app-rewired for solved this issue

---

<div class="post-metadata">

**Author:** ![jagathprasad0](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jagathprasad0/32/9575_2.png) [@jagathprasad0](https://devforum.zoom.us/u/jagathprasad0)\
**Post date:** [July 22, 2020, 2:03pm UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/21 "2020-07-22T14:03:16Z")

</div>

Hi Team,  
I am also facing the same issue in angular , Please any one found fix please help me,  
Because, I am facing big problem in production from my clients.

 ![prod issue](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/5/58f3d863266ddb29b980eca7a704b336725a008f.png)

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 27, 2020, 1:12am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/24 "2020-07-27T01:12:04Z")

</div>

Hey @jagathprasad0, @muhamadangga609, @eleal,

I was not able to reproduce this issue using [GitHub pages](https://pages.github.com/) and the Angular sample app here with the built version in /docs:

> **[tommygaessler/websdk-sample-angular-live](https://github.com/tommygaessler/websdk-sample-angular-live)**
>
> Live Example of Zoom Web SDK with Angular. Contribute to tommygaessler/websdk-sample-angular-live development by creating an account on GitHub.

I used `$ ng build --prod`

Deployed site:

[https://tommygaessler.com/websdk-sample-angular-live/](https://tommygaessler.com/websdk-sample-angular-live/)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![LysR777](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@LysR777](https://devforum.zoom.us/u/LysR777)\
**Post date:** [August 26, 2020, 2:06am UTC](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264/25 "2020-08-26T02:06:11Z")

</div>

Was this fixed in Zoom Web SDK version 1.8.0 released today? I was having a similar issue yesterday:

```
nuxt Error while "mounting" app: SyntaxError: Unexpected end of JSON input

```

…while using SDK version 1.7.9, npm, nuxt, vuejs. It worked locally, but I got the above error in production.

I spent most of yesterday doing fresh installs of the SDK, as well as all packages from scratch, thinking something was corrupt or cached. When I did the same today, I noticed I was now installing 1.8.0, and it finally worked on my production server.

[Next page](https://devforum.zoom.us/t/unexpected-end-of-json-when-source-map-disabled/19264.md?page=2)
