# Uncaught SyntaxError: Unexpected token '\<'

**URL:** <https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279>\
**Category:** Web\
**Created:** [October 14, 2020, 10:11pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279 "2020-10-14T22:11:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![diego.luis.gomes2015](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/diego.luis.gomes2015/32/27757_2.png) [@diego.luis.gomes2015](https://devforum.zoom.us/u/diego.luis.gomes2015)\
**Post date:** [October 14, 2020, 10:11pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/1 "2020-10-14T22:11:10Z")

</div>

**Description**  
I’m trying to integrate the sdk zoom with react, however every time I try to run the project after following all the steps described I have the error ‘Uncaught SyntaxError: Unexpected token ‘\<’’ as return

**Error**  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/0/c/0c4a5ef71fe896140faa7300c332f51400be7a01.png)

**Which version?**  
On the setZoomJsLib i used 1.8.0v and in my packge.json i use the 1.8.1v.

I had test’s from my desktop (win 10) with the google chrome and microsoft edge.

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:  
the error occurs as soon as I run the project.

**Additional context**

This is the component code:  
import React from ‘react’;

import { ZoomMtg } from ‘@zoomus/websdk’;

import ‘./zoom.css’;

console.log(“checkSystemRequirements”);

console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));

ZoomMtg.setZoomJSLib(‘[https://source.zoom.us/1.8.0/lib](https://source.zoom.us/1.8.0/lib)’, ‘/av’);

ZoomMtg.setZoomJSLib(‘node\_modules/@zoomus/websdk/dist/lib/’, ‘/av’);

ZoomMtg.preLoadWasm();

ZoomMtg.prepareJssdk();

const Zoom = () =\> {

```
const Endpoint = "http://localhost:4000";

var meetingNumber = 75594056340

var user = 'Diego'

var roleUser = 0

const meetConfig = {

    apiKey: process.env.API_KEY,

    meetingNumber: meetingNumber,

    leaveUrl: 'https://www.google.com',

    userName: user,

    userEmail: '',

    passWord: '', // if required

    role: roleUser // 1 for host; 0 for attendee

};

const getSignature = () => {

    fetch(`${Endpoint}`, {

        method: 'POST',

        body: JSON.stringify({ meetingData: meetConfig })

    })

        .then(result => result.text())

        .then(response => {

            ZoomMtg.init({

                leaveUrl: meetConfig.leaveUrl,

                isSupportAV: true,

                success: function () {

                    ZoomMtg.join({

                        signature: response,

                        apiKey: meetConfig.apiKey,

                        meetingNumber: meetConfig.meetingNumber,

                        userName: meetConfig.userName,

                        // password optional; set by Host

                        passWord: meetConfig.passWord,

                        error(res) {

                            console.log(res)

                        }

                    })

                }

            })

        }

)}

return <button onClick={() => getSignature()}>Teste</button>

```

}

```
export default Zoom
```

---

<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:** [October 15, 2020, 10:44pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/2 "2020-10-15T22:44:17Z")

</div>

Hey @diego.luis.gomes2015,

This is most likely happeneing when you are calling JSON.stringify. I am guessing your `process.env.API_KEY` value is not set or coming through to your code.

Can you try logging `process.env.API_KEY` before you are calling JSON.stringify to see if you get a value?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![diego.luis.gomes2015](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/diego.luis.gomes2015/32/27757_2.png) [@diego.luis.gomes2015](https://devforum.zoom.us/u/diego.luis.gomes2015)\
**Post date:** [October 16, 2020, 5:50pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/3 "2020-10-16T17:50:54Z")

</div>

i fixed the ‘undefined’ **process.env.API\_KEY** but the error still happen

![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/0/2/0292c24a3499bc8864b5ed1e4be006403a263d6a.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:** [October 20, 2020, 4:23pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/4 "2020-10-20T16:23:50Z")

</div>

Hey @diego.luis.gomes2015,

What is the response you are getting from your signature server?

> [@diego.luis.gomes2015](#):
>
> ```auto
> fetch(`${Endpoint}`, {
> 
> method: 'POST',
> 
> body: JSON.stringify({ meetingData: meetConfig })
> 
> })
> 
> .then(result => result.text())
> 
> ```

Are you able to log the response? Also what is `.text()` doing?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![diego.luis.gomes2015](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/diego.luis.gomes2015/32/27757_2.png) [@diego.luis.gomes2015](https://devforum.zoom.us/u/diego.luis.gomes2015)\
**Post date:** [October 22, 2020, 6:31pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/5 "2020-10-22T18:31:52Z")

</div>

I receveid my signature  
**{**  
\*\* “signature”: “”\*\*  
**}**

And the **.then(result =\> result.text())**, i removed because i don’t use it.

**.init** em **.join** works now but the error stills here

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 23, 2020, 1:45pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/6 "2020-10-23T13:45:28Z")

</div>

Hey @diego.luis.gomes2015,

> On the setZoomJsLib i used 1.8.0v and in my packge.json i use the 1.8.1v.

Can you please ensure that you’re providing the version of the SDK that you’re using in your package json here as well: ZoomMtg.setZoomJSLib

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![diego.luis.gomes2015](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/diego.luis.gomes2015/32/27757_2.png) [@diego.luis.gomes2015](https://devforum.zoom.us/u/diego.luis.gomes2015)\
**Post date:** [October 28, 2020, 2:57pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/7 "2020-10-28T14:57:40Z")

</div>

Thanks Will  
I redid the project but now i used sdk v1.81 and calling then in my compenent with ‘setZoomJsLib 1.8.0v’ this works for me

---

<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:** [October 29, 2020, 10:11pm UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/8 "2020-10-29T22:11:04Z")

</div>

Happy to hear you got it sorted out @diego.luis.gomes2015! 🙂

Please let us know if you need help with anything else!

-Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 29, 2020, 8:11am UTC](https://devforum.zoom.us/t/uncaught-syntaxerror-unexpected-token/33279/9 "2020-11-29T08:11:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
