react-bootstrap: Failed to compile. Attempted import error.

I happened to reinstall my project workspace and I found that react start after npm install throws the below error.

Failed to compile.

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

react-bootstrap: 1.1.0 bootstrap: 4.5.0

Last I checked was on 2-Jul-2020 and I did not observe this issue.

I tried to npm cache clean --force but was not able to get it resolved.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 28
  • Comments: 19 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Tried with different versions v1.0.0 and v1.0.1 and v1.1.0 still getting same error. This error has created big problem for me on the verge of release.

Creating an optimized production build… Failed to compile.

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

@sachin8094 @cvitaa11 v1.0.1 should work fine. Ensure that you have not included the ‘^’ or ‘~’ symbol prefixed to the version number for react-bootstrap in package.json. Then delete the react-bootstrap folder from node_modules. do an npm install again. Then start the server.

uninstalling react-bootstrap then installing it again on v1.0.1 or v1.0.0 works. npm uninstall react-bootstrap npm install react-bootstrap@1.0.1

It also works if you roll back to react-bootstrap version v1.0.1: npm install react-bootstrap@1.0.1

This seems like a problem with react-bootstrap v1.1.0. We’re deploying our app with Vercel, so I ended up having to create a yarn.lock file (using yarn install and yarn add react-bootstrap@1.0.1) in order to successfully roll back the react-bootstrap version on the latest deployment.

Tried with different versions v1.0.0 and v1.0.1 and v1.1.0 still getting same error. This error has created big problem for me on the verge of release.

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’m getting a bunch of warnings. See https://github.com/captain-igloo/react-bootstrap-bug.git .

Version 1.0.0-beta.12 is fine.

uninstalling react-bootstrap then installing it again on v1.0.1 or v1.0.0 works. npm uninstall react-bootstrap npm install react-bootstrap@1.0.1

This is the Solution