Git Product home page Git Product logo

Comments (9)

CKanishka avatar CKanishka commented on June 25, 2024 2

Hello,
I have the same issue but with the newer version of rasa-webchat. Any help please ?

Yeah I am also having the issue when I try to run it in a Linux environment.

from rasa-webchat.

Ripza avatar Ripza commented on June 25, 2024 1

@dliuproduction It works without problems πŸ‘

from rasa-webchat.

mounabenayed avatar mounabenayed commented on June 25, 2024 1

Hello,
I have the same issue but with the newer version of rasa-webchat. Any help please ?

from rasa-webchat.

dliuproduction avatar dliuproduction commented on June 25, 2024

Hi, can you provide the snippet where you import and render the component? The error seems weird as the init method in the plugin mode is called. The problem might be in the usage as a react component.

from rasa-webchat.

Ripza avatar Ripza commented on June 25, 2024

Sure!

import React, { Component } from 'react'
import { Widget } from 'rasa-webchat'

class WChat extends Component {

  buildChat = () => {
    return (
      <Widget
        interval={2000}
        initPayload={"/get_started"}
        socketUrl={"http://localhost:5500"}
        socketPath={"/socket.io/"}
        title={"Title"}
        inputTextFieldHint={"Type a message..."}
        connectingText={"Waiting for server..."}
        embedded={true}
        params={{
          images: {
            dims: {
              width: 300,
              height: 200
            }
          },
          storage: "local"
        }}
      />
    )
  }

  render() {
    return (
      <div className="webchat-container" >
        {this.buildChat()}
      </div>
    )
  }
}

export default WChat;

Calling in this router:

import React from 'react';
import { BrowserRouter, Switch } from "react-router-dom";
import WChat from "./components/WebChat/WebChat";

export default () => {

 return (
   <BrowserRouter>
    <Switch>
      <Route path="/web-chat/" component={WChat} />
    </Switch>
   </BrowserRouter>
 )
}

Another example:

import WChat from './components/WebChat/WebChat'

ReactDOM.render(<WChat />, document.getElementById('app'));

I tried a lot of differents ways, but all responds the same.

This is my webpack:

const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
  entry: './src/index.js',
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: ['babel-loader'],
      },
      {
        test: /\.css$/,
        use: [
          { loader: 'style-loader' },
          {
            loader: 'css-loader'
          }
        ]
      },
      {
        test: /\.html$/,
        exclude: /node_modules/,
        loader: 'html-loader'
      },
      {
        test: /\.(png|jpg|gif)$/,
        use: [
          {
            loader: 'url-loader',
            options: {
              limit: 8192
            }
          }
        ]
      }
    ]
  },
  output: {
    filename: 'bundle.js'
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: 'public/index.html'
      //favicon: 'public/favicon.ico'
    })
  ],
  devServer: {
    host: '0.0.0.0',
    port: 3000,
    overlay: true,
    historyApiFallback: true,
    open: true
  }
};

and .babelrc:

{
  "presets": ["@babel/preset-env", "@babel/preset-react"],
  "plugins": [
    "@babel/plugin-proposal-class-properties"
  ]
}

Thanks for your time

from rasa-webchat.

dliuproduction avatar dliuproduction commented on June 25, 2024

Thanks for the example. We actually ran into the same problem on some environments, but not all. What OS are you running?

from rasa-webchat.

Ripza avatar Ripza commented on June 25, 2024

Tha's rare ... I'm running Ubuntu Desktop 18.10

from rasa-webchat.

Ripza avatar Ripza commented on June 25, 2024

Hmmm ... I downloaded the repo using the contributors steps and linked the import to the location of the repo. When I started the project it runs perfectly, but with this change in the package.json in rasa-webchat:

"webpack-cli": "^3.1.2",

When I tried without it the compiler said this:

/rasa-webchat/node_modules/webpack-cli/bin/config-yargs.js:89
                                describe: optionsSchema.definitions.output.properties.path.description,
                                                                           ^

TypeError: Cannot read property 'properties' of undefined

Using node 10.14.1.

from rasa-webchat.

dliuproduction avatar dliuproduction commented on June 25, 2024

Hi @Ripza. Can you test with branch fix/package-lock? I added fixes for webpack and build scripts.

from rasa-webchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.