# \`NaN\` is an invalid value for the \`width\` css style property

**URL:** <https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963>\
**Category:** Web\
**Created:** [April 20, 2020, 3:59am UTC](https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963 "2020-04-20T03:59:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dashawk](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@dashawk](https://devforum.zoom.us/u/dashawk)\
**Post date:** [April 20, 2020, 3:59am UTC](https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963/1 "2020-04-20T03:59:16Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/4/4549063a055a2a8359b7db66e1a79a1403129cb4.png)  
Everytime I join a meeting, I always get this error in the console, though I can successfully join a meeting, it just bothers me if there is an error in the console that is not handled.

Here is my configuration.

```javascript
...
const query = this.props.router.query;
this.setState({
    meetingNumber: query.mid,
    userName: atob(query.un),
    passWord: query.pwd,
    signature: query.sg,
    leaveUrl: `/zoom?mid=${query.mid}&pwd=${query.pwd}&un=${query.un}&sg=${query.sg}&md=1`,
});
...
const signature = ZoomMtg.generateSignature({
    meetingNumber: meetConfig.meetingNumber,
    apiKey: meetConfig.apiKey,
    apiSecret: meetConfig.apiSecret,
    role: meetConfig.role,
    success: function (res) {
        console.log(res.result);
    }
});
// BTW this does not work, it did not remove the invite button
ZoomMtg.showInviteFunction({ show: false });

ZoomMtg.init({
    leaveUrl: this.state.leaveUrl,
    isSupportAV: true,
    disableInvite: false,
    audioPanelAlwaysOpen: false,
    isSupportChat: false,
    success: function () {
        ZoomMtg.join({
          meetingNumber: meetConfig.meetingNumber,
          userName: meetConfig.userName,
          userEmail: '',
          signature: signature,
          apiKey: meetConfig.apiKey,
          passWord: meetConfig.passWord,
          success: function (res) {
            wrapper.hide();
            $('body').removeClass('loading-pointer');

            $(document).on('click', () => {
              setTimeout(() => {
                const participantHeader = $('chat-participant-header');
                console.log(participantHeader);
                if (participantHeader.is(':visible')) {
                  console.log('it is visible');
                }
              }, 100);
            });
          },
          error: function (res) {
            console.log(res);
          }
        });
      },

```

Is there something missing in my configuration?

---

<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:** [April 21, 2020, 2:26am UTC](https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963/2 "2020-04-21T02:26:39Z")

</div>

Hey @dashawk,

I have also noticed this error. Although it is annoying, it is not a blocker and does not break anything.

We will work on fixing this, but don’t worry too much. 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![cmudhar](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@cmudhar](https://devforum.zoom.us/u/cmudhar)\
**Post date:** [July 15, 2020, 7:23pm UTC](https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963/3 "2020-07-15T19:23:49Z")

</div>

Has this been resolved? UI rendered is messy may be because of this error.

Here is part of my Angular Component Code

```
ngOnInit() {
    this.loadConfiguration();
}

joinMeeting() {
    if (this.meetingConfig) {
        var config = this.meetingConfig;
        try {
            ZoomMtg.join({
                signature: config.signature,
                meetingNumber: config.meetingNumber,
                userName: (config.userName == null || config.userName.toString().trim() == '') ? 'no name user' : config.userName,
                apiKey: config.apiKey,
                userEmail: (config.userEmail == null || config.userEmail.toString().trim() == '') ? 'noemail@nodomain.com' : config.userEmail, // "yogesh.dahiya@rsystems.com",
                passWord: (config.meetingPassword == null || config.meetingPassword.toString().trim() == '') ? '' : config.meetingPassword,
                success: (success) => {
                    //console.log(success)
                    this.showsideNavButton();
                },
                error: (error) => {
                    console.log(error);
                    this.onZoomError(config);
                }
            })
        }
        catch (e) {
            console.log(e);
            this.onZoomError(config);
        }
    }
}

private loadConfiguration() {

    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();

    this.onlineSessionService.getConfiguration({ eventId: this.eventID, PID: this.pid }).subscribe((o) => {
        this.meetingConfig = o.data;
        if (o.data && !this.IsNullOrEmpty(o.data.meetingNumber)) {
            this.zoomInit(o.data.apiSecret)
        } else
            this.onZoomError(o.data);
    });
}

private zoomInit(sSecret) {
    var apiSecret = sSecret; //o.data.apiSecret;
    var config = this.meetingConfig;
    try {
        ZoomMtg.init({
            leaveUrl: config.onLeaveURL,
            webEndpoint: config.webEndpoint,
            isSupportAV: true,
            success: (success) => {
                config.signature = this.generateSignature(this.meetingConfig.apiKey, apiSecret
                    , this.meetingConfig.meetingNumber, 0);

                this.joinMeeting();
            },
            error: (error) => {
                console.log(error);
                this.onZoomError(config);
            }
        })
    }
    catch (e) {
        console.log(e);
        this.onZoomError(config);
    }
}

private onZoomError(oData) {
    if (oData && !this.IsNullOrEmpty(oData.onLeaveURL))
        this.Redirect(oData.onLeaveURL);
    else
        this.Redirect('/');
}

generateSignature(apiKey, apiSecret, meetingNumber, role) {
    // Prevent time sync issue between client signature generation and zoom 
    const timestamp = new Date().getTime() - 30000
    const msg = Buffer.from(apiKey + meetingNumber + timestamp + role).toString('base64')
    const hash = crypto.createHmac('sha256', apiSecret).update(msg).digest('base64')
    const signature = Buffer.from(`${apiKey}.${meetingNumber}.${timestamp}.${role}.${hash}`).toString('base64')

    return signature
}
```

---

<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 17, 2020, 6:23pm UTC](https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963/4 "2020-07-17T18:23:58Z")

</div>

Hey @cmudhar,

> [@cmudhar](#):
>
> UI rendered is messy may be because of this error.

Can you please share a screenshot of the UI issue?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![cmudhar](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@cmudhar](https://devforum.zoom.us/u/cmudhar)\
**Post date:** [July 17, 2020, 8:02pm UTC](https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963/5 "2020-07-17T20:02:03Z")

</div>

Found the issue, there were other css files conflicting while rendering UI, but this JS error still there.  
Now the UI renders ok, but the color scheme is way off (topic for another thread).

My request is complete for now.

Thanks

---

<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 21, 2020, 9:24pm UTC](https://devforum.zoom.us/t/nan-is-an-invalid-value-for-the-width-css-style-property/13963/6 "2020-07-21T21:24:19Z")

</div>

Happy to hear you fixed the issue! 🙂

Thanks,  
Tommy
