You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my react zendesk webchat, I try to make a form to send the user name, email, and phone number.
For this I initialize the webchat, set the current visitor, then I send the data.
Here is my code:
constmsg={name: this.inputNameRef.current.value,email: this.inputMailRef.current.value,phone: this.inputPhoneRef.current.value,message: `Demande de démo depuis ${this.getDemoRequestPath()}`};// {name: "foo bar", email: "foo@bar.io", phone: "0611223344", message: "Demande de démo depuis /solutions/theapp"}// Need to init the chat to be able to send offline message..if(!this.props.data.isChatInit){zChat.init({account_key: ACCOUNT_KEY});this.props.dispatch({type: 'initChat'});}zChat.setVisitorInfo({display_name: this.inputNameRef.current.value,email: this.inputMailRef.current.value,phone: this.inputPhoneRef.current.value},(err)=>{if(err)log('Error setting visitor info');});zChat.sendOfflineMsg(msg,(err)=>{if(err)log('Error sending demo request form');});
When I try this, setVisitorInfo trigger this error:
web-sdk.js?452d:1453 Uncaught TypeError: Cannot set property 'lastIndex' of undefined
at eval (eval at <anonymous> (widget.js:1465), <anonymous>:1453:21)
at i.E.validate (eval at <anonymous> (widget.js:1465), <anonymous>:1533:13)
at eval (eval at <anonymous> (widget.js:1465), <anonymous>:1411:25)
at i.E.validate (eval at <anonymous> (widget.js:1465), <anonymous>:1533:13)
at eval (eval at <anonymous> (widget.js:1465), <anonymous>:1433:22)
at i.E.validate (eval at <anonymous> (widget.js:1465), <anonymous>:1533:13)
at le (eval at <anonymous> (widget.js:1465), <anonymous>:5038:27)
at h (eval at <anonymous> (widget.js:1465), <anonymous>:4559:12)
at Object.eval [as setVisitorInfo] (eval at <anonymous> (widget.js:1465), <anonymous>:5220:33)
at DemoRequestForm.send (eval at <anonymous> (widget.js:2221), <anonymous>:139:24)
If I comment setVisitorInfo, and just leave sendOfflineMsg the same error is trigger.
I check: my msg is correct, and the init is executed. And I do not receive anything from zChat.on()
This is a zChat bug or just me who is forgotten an info?
The text was updated successfully, but these errors were encountered:
On my react zendesk webchat, I try to make a form to send the user name, email, and phone number.
For this I initialize the webchat, set the current visitor, then I send the data.
Here is my code:
When I try this,
setVisitorInfo
trigger this error:If I comment
setVisitorInfo
, and just leavesendOfflineMsg
the same error is trigger.I check: my msg is correct, and the init is executed. And I do not receive anything from
zChat.on()
This is a zChat bug or just me who is forgotten an info?
The text was updated successfully, but these errors were encountered: