Unexpected end of JSON when source map disabled

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 ‘eval-source-map’),

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

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();
  }
}
1 Like

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:

1 Like

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

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

Hey @spandit, @grahaampeterson, @avand,

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

Let me know if that helps!

Thanks,
Tommy

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?

Hey @lucille.hua,

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

Thanks,
Tommy

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

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

1 Like

Hey @prantikde, @perseus362434,

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

Thanks,
Tommy

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

Thanks,
Prantik

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:

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

Hey @tommy

Thanks for checking it out.
I hope it gets solved soon :grimacing:

Thanks,
Prantik

1 Like

Happy to help! :slight_smile:

I will keep you updated!

Thanks,
Tommy

1 Like

Any update about this issue?

1 Like

waiting update for this issue

i use react-app-rewired for solved this issue

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.

Hey @jagathprasad0, @muhamadangga609, @eleal,

I was not able to reproduce this issue using GitHub pages and the Angular sample app here with the built version in /docs:

I used $ ng build --prod

Deployed site:

https://tommygaessler.com/websdk-sample-angular-live/

Thanks,
Tommy

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.