0

I tried to install react-bootstrap and followed these instructions:

https://react-bootstrap.github.io/getting-started/introduction

However after starting the app (simulated device via Android Studio) I receive this error:

error: bundling failed: Error: Unable to resolve module `bootstrap/dist/css/bootstrap.min.css` from `index.js`: bootstrap/dist/css/bootstrap.min.css could not be found within the project.

My dependencies are as follows:

"dependencies": {
    "bootstrap": "^4.4.1",
    "react": "16.9.0",
    "react-bootstrap": "^1.0.0-beta.16",
    "react-native": "0.61.5"

And both modules are within node_modules and so is the file bootstrap.min.css. I tried things like

import 'bootstrap/dist/css/bootstrap.min.css';
import './node_modules/bootstrap/dist/css/bootstrap.min.css';
import '../node_modules/bootstrap/dist/css/bootstrap.min.css'; (should be wrong anyways);

(in index.js and also App.js like mentioned in the instructions)

I also read here:

https://github.com/reactstrap/reactstrap/issues/1325

and here:

Can't resolve '../node_modules/bootstrap/dist/css/bootstrap.min.css'?

but I have the import like in the given answer.

I tried an older version of react-bootstrap and bootstrap and I deleted all node_modules and resinstalled them even though the "missing" file is there.

My project is basically a vanilla react-native project. I just started with npx react-native init name and tried to add bootstrap, so nothing has changed.

What is the issue here?

1 Answer 1

1

Problem is you are trying to use react bootstrap with react-native project.

 react-bootstrap : only support react.js projects not in react-native
Sign up to request clarification or add additional context in comments.

2 Comments

let me know if you have any query
Uhm I don't know how I missed that....thank you even though it was not the answer I was looking for

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.