Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
188
rated 0 times [  190] [ 2]  / answers: 1 / hits: 54831  / 5 Years ago, sat, august 31, 2019, 12:00:00

I am working on a project of react and I am getting the following error after implement this package https://www.npmjs.com/package/react-bootstrap-typeahead then i get the following error.



Failed to compile

./node_modules/react-popper/lib/cjs/Popper.js
Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutPropertiesLoose' in 'E:reactjsdeveans-react-versionnode_modulesreact-popperlibcjs'

This error occurred during the build time and cannot be dismissed.


I found many solutions and I tried it too https://github.com/jquense/yup/issues/216 but still getting same error.



But when i remove Typeahead component then it works fine.



import React , { Component } from 'react'
import {Typeahead} from 'react-bootstrap-typeahead';
import 'react-bootstrap-typeahead/css/Typeahead.css';
class States extends Component {

state = {
multiple: false,
options: [
{id: 1, label: 'Pakistan'},
{id: 2, label: 'Indonesia'},
{id: 3, label: 'Turkey'},
{id: 4, label: 'Brazil'},
]
};

render () {

const {multiple} = this.state;

return (
<div>
<Typeahead
labelKey=label
multiple={multiple}
options={this.state.options}
placeholder=Choose a state...
/>
</div>
)
}
}
export default States

More From » reactjs

 Answers
10

I found a solution


npm install --save-exact @babel/[email protected]

Then delete the package-json.lock file and node_modules folder then re-install with npm install.


It works for me.


[#51709] Friday, August 23, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arron

Total Points: 663
Total Questions: 119
Total Answers: 112

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
;