Search code examples
javascriptreactjsfrontenduglifyjs

SyntaxError: Unexpected token: operator (>)


I am using react-bootstrap-typeahead library in my React package.

I have added these import statements as per the documents:

import { Typeahead } from "react-bootstrap-typeahead";
import "react-bootstrap-typeahead/css/Typeahead.css";

and rendering:

<Typeahead
  id="basic-typeahead-example"
  onChange={this.handleChange}
  options={this.state.options}
  placeholder="Choose..."
/>

When try to build, I am getting:

static/js/main.4b322a5a.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/react-bootstrap-typeahead/~/escape-string-regexp/index.js:3,0]

Can some tell where is the actual problem as the code is running perfectly when I do npm run. Is there any problem with react-bootstrap-typeahead library?


Solution

  • I installed the lower version for this library and it worked