Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile. Attempted import error. #5267

Closed
samja666 opened this issue Jul 6, 2020 · 19 comments
Closed

Failed to compile. Attempted import error. #5267

samja666 opened this issue Jul 6, 2020 · 19 comments

Comments

@samja666
Copy link

samja666 commented Jul 6, 2020

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.

@samja666 samja666 changed the title Failed to compile. import error. Failed to compile. Attempted import error. Jul 6, 2020
captain-igloo pushed a commit to captain-igloo/react-bootstrap-bug that referenced this issue Jul 6, 2020
@captain-igloo
Copy link

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.

@anthony-zhou
Copy link

anthony-zhou commented Jul 6, 2020

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.

@samja666
Copy link
Author

samja666 commented Jul 6, 2020

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.

@anthony-zhou i am rolling back to 1.0.0. as i do not observe this issue there.

I am having the exact same issue with 1.0.1 as well
"react-bootstrap": "^1.0.1"

edit: rolling back to v1.0.1 works

@taion
Copy link
Member

taion commented Jul 6, 2020

@jquense looks like the FooProps imports/exports made it into the compiled CJS code in 1.1.0: https://unpkg.com/browse/react-bootstrap@1.1.0/cjs/index.js

should we swap these out for import type/export type so TS doesn't do something weird?

@bennybennett
Copy link

I had the exact same problem, just FYI, same components listed in error. Reverted to v1.0.1 for the time being.

@peetss
Copy link

peetss commented Jul 7, 2020

I ran into this as well.

npm install react-bootstrap@1.0.1 did not fix it.

yarn install did not fix it.

yarn add react-bootstrap@1.0.1 did fix it.

@ghost
Copy link

ghost commented Jul 7, 2020

Having the same issue

@dappsh
Copy link

dappsh commented Jul 7, 2020

I have the same issue, fixed by rolling back the version to 1.0.0

"react-bootstrap": "1.0.0"

@ghost
Copy link

ghost commented Jul 7, 2020

any idea ? I changed it to 1.0.0 still has the error

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

@letsgitcracking
Copy link

letsgitcracking commented Jul 7, 2020

any idea ? I changed it to 1.0.0 still has the error

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

Same problem here.

One thing I noticed though is that my VSCode is displaying the version of react-bootstrap incorrectly in package.json, whereas in notepad it's correct. Might be something to do with VSCode on windows or a cache problem?

@DevSachinTiwari
Copy link

I also facing the same issue.. what is the solution/?

@DevSachinTiwari
Copy link

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.


i was facing the same issue. try to install react-bootstrap@1.0.1 and start server again. It should be work now.

@yash17a
Copy link

yash17a commented Jul 7, 2020

npm i react-bootstrap@1.0.1 --save works well.

@rvmeode-fs
Copy link

rvmeode-fs commented Jul 7, 2020

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

@cvitaa11
Copy link

cvitaa11 commented Jul 7, 2020

I'm having the same issue. I tried to downgrade dependency to v 1.0.0-beta.6, 1.0.0 and 1.0.1 but the same error occured every time.

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
Copy link

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'.

@samja666
Copy link
Author

samja666 commented Jul 7, 2020

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.

@djnadackal
Copy link

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

@letsgitcracking
Copy link

letsgitcracking commented Jul 7, 2020

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

Thanks, this solution works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests