0

I want integrate a twilio chat in my reactjs app. For that I am using "twilio-ip-messaging-react" package. I have installed it. when I run the app I am getting following error.

./~/twilio-ip-messaging-react/ip_chat_client.jsx
Module parse failed: 
/home/projectName/node_modules/twilio-ip-messaging-react/ip_chat_client.jsx Unexpected token (56:8)
You may need an appropriate loader to handle this file type.
|     if (this.state.messagingClient) {
|       return (
|         <div>
|           <IPChatChannelManager
|             messagingClient={this.state.messagingClient}

I have changed webpack.js also, but still getting same error.

Any one can tell me how to fix it and why raising this error?

Thank you every one.

neelima
  • 461
  • 10
  • 25
  • That is quite an old package, last published over a year ago. Twilio Programmable Chat (no longer IP Messaging) has evolved quite a bit over that time, so it probably doesn't work well with this package any more. I'd recommend looking for a more up to date package or building your own components. – philnash Oct 31 '17 at 23:39

1 Answers1

0

Can you check your webpack config file, it looks like you do not have support for *.jsx files.

Try to insert these lines in your webpack config

resolve: {
   extensions: [".js", ".json", ".jsx"]
}
Slawa Eremin
  • 5,264
  • 18
  • 28