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

Viewed 4317

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.

4 Answers

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",

For future googlers using create-react-app with Typescript template, updating Typescript version to 3.8 did the trick for me.

npm install typescript@3.8

Deleted node_modules and npm i again, that worked for me. Might also be some cache problem never forget that.

Related