0

My app breaks during production build when I try to use react-chat-widget widget.

When I delete the widget the problem goes away.

Here's my

App.js:

import Navbar from './Navbar'
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.min.js';
import './css/main.css';
import SlideShow from './SlideShow'
import SearchAndBackground from './SearchAndBackground'
import ActionMenu from './ActionMenu'
import Contact from './Contact'
import Footer from './Footer'
import { BrowserRouter as Router, Switch } from "react-router-dom";
import axios from 'axios'
import React, {useEffect, useState} from 'react';
import { Widget, addResponseMessage, addLinkSnippet, addUserMessage } from 'react-chat-widget';
import 'react-chat-widget/lib/styles.css';
import messageHandler from './messageHandler'


export default function App() {

  const [prevResp, setPrevResp] = useState('')

  useEffect(() => {
    addResponseMessage('Hi! Let us help you find what you are looking for!');
    addResponseMessage('If you want to speak with our agents simply type "help"');
    addResponseMessage('Please type buy, rent, or sell for us to navigate to your likings.');
    addResponseMessage('If you are roman or ismail, please type pizduyar.');
    setPrevResp('Please type buy, rent, or sell for us to navigate to your likings.')
  }, []);

  const handleNewUserMessage = (newMessage) => {
    // Now send the message throught the backend API
    var str = messageHandler(prevResp, newMessage)
    setPrevResp(str)
    addResponseMessage(str)
    console.log(prevResp)

  }

  return (
    <div className="App">
      <Navbar/>
      <SearchAndBackground/>
      <SlideShow/>
      <ActionMenu/>
      <Widget
          handleNewUserMessage={handleNewUserMessage}
          title="Royar Help Desk"
          subtitle="online"
        />
      <Contact/>}
      <Footer/>
    </div>
  );
}

Error recieved from console:


ℹ 「wds」: Project is running at http://172.16.0.50/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /Users/ahmet/Desktop/royar/public
ℹ 「wds」: 404s will fallback to /
Ahmet Uyar
  • 17
  • 5
  • 1
    Did you look in the developer console for errors? – Matt Jul 06 '21 at 21:34
  • ℹ 「wds」: Project is running at http://172.16.0.50/ ℹ 「wds」: webpack output is served from ℹ 「wds」: Content not from webpack is served from /Users/ahmet/Desktop/royar/public ℹ 「wds」: 404s will fallback to / – Ahmet Uyar Jul 06 '21 at 21:50

0 Answers0