I am using a truffle box react - after truffle unbox react everything works fine

Later however, after yarn add @material-ui/core

I get an error: Can't resolve 'react'

The same happens after installing react-bootstrap

Any idea how to fix it? The goal is to have a full truffle react box setup + either material-ui or boostrap-react.


I cloned the react-box repo, installed all the dependencies and again everything worked fine

After that, I created a new project, cloned again, but this time I edited package.json by adding "react-bootstrap": "0.32.4" dependency

I run

npm install 

in my component:

import Button from 'react-bootstrap/Button';

<Button variant="primary">Primary</Button>

to check if it works, but after

npm start 

this time I run into:

Can't resolve 'react-bootstrap/Button'

I don't mix yarn with npm, just tried both approaches with different projects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.