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)
Links to this issue
Commits related to this issue
- see https://github.com/react-bootstrap/react-bootstrap/issues/5267 — committed to captain-igloo/react-bootstrap-bug by deleted user 4 years ago
- fix(types): type exports not being removed from compiled out fixes #5267 — committed to react-bootstrap/react-bootstrap by jquense 4 years ago
- react-bootstrap versiot kuntoon, github.com/react-bootstrap/react-bootstrap/issues/5267 — committed to Vexild/CafeWebsite by mkajula 4 years ago
@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-bootstrapnpm install react-bootstrap@1.0.1It also works if you roll back to react-bootstrap version v1.0.1:
npm install react-bootstrap@1.0.1This 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 installandyarn 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.
This is the Solution