Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Bootstrap error: 'AccordionCollapseProps' is not exported from './AccordionCollapse'

I added Bootstrap and routing to a frontend, deleted my node_modules, and re-installed them with yarn install. When I try to npm run build, I get:

Creating an optimized production build...
Failed to compile.

./node_modules/react-bootstrap/esm/index.js
Attempted import error: 'AccordionCollapseProps' is not exported from './AccordionCollapse'.

I'd like to fix this error. I can post more extensive code if helpful.

like image 306
neutrino Avatar asked Jul 07 '20 01:07

neutrino


2 Answers

There is an open issue in their github repo: https://github.com/react-bootstrap/react-bootstrap/issues/5267

One reported fix is to roll back to version 1.0.1.

npm install [email protected] --save

That worked for me.

like image 71
zxvaf Avatar answered Sep 19 '22 19:09

zxvaf


After zxvaf's solution if the problem still continues you should also remove ^ character from react-bootstrap in package.json file. So it should be like this

    "react-bootstrap": "1.0.1",
like image 36
3mincan Avatar answered Sep 19 '22 19:09

3mincan