0

Error whch i was facing I was using Bootstrap v3.3.6 and jQuery v2.2.4

Do i need to change the version not to get this error. I am having index.html like below

 <html lang="en">
 <head>
     <link href="css/style.css" rel="stylesheet">
</head>
  <body class="nav-md">
 <div id="app"></div>
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/custom.min.js"></script>
<script src="/bundle.js"></script> 

 </body>

  </html>

Index.js file

import 'babel-polyfill';
 import React from 'react';
import ReactDOM from 'react-dom';
  import { Provider } from 'react-redux';
 import { Router, browserHistory } from 'react-router';
  import routes from './routes';


  import './css/bootstrap.min.css';
  import './css/custom.min.css';
  import './css/style.css';

   import './js/jquery.min.js';
   import './js/bootstrap.min.js';
    import './js/custom.min.js';





    import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
  import {indigoA200} from 'material-ui/styles/colors';
   import getMuiTheme from 'material-ui/styles/getMuiTheme';
 const muiTheme = getMuiTheme({
    palette: {
    primary1Color: indigoA200,
    primary2Color: indigoA200,
    },
  });

ReactDOM.render((
   <MuiThemeProvider muiTheme={muiTheme}>
    <Router history={browserHistory} routes={routes} />
</MuiThemeProvider>)
,document.getElementById('app')
 );

I am unable to see the UI, I am getting Bootstrap's JavaScript requires jQuery

sivasai081
  • 65
  • 3
  • 11
  • What exactly is the error? Could you mention the error message? Also, I would recommend using the current CDN's from https://www.w3schools.com/bootstrap/bootstrap_get_started.asp and see if that solves the issue? – BanelingRush Feb 07 '19 at 06:19
  • Might be a duplication of https://stackoverflow.com/questions/22658015/bootstrap-throws-uncaught-error-bootstraps-javascript-requires-jquery – BanelingRush Feb 07 '19 at 06:21

1 Answers1

0

From the given messages your jQuery Bootstrap and other files seem to not be properly set up and contain some errors and javascript is run on a single thread and hence it is terminating execution without reaching the completion of file and throwing the error. Please check your jQuery and Bootstrap files and try to use the CDN's from Getting Start with Bootstrap

As far as I am aware you have used imports wrong and if your index.html file has the src you are not required to import it within the index.js file and can use all the classes similarly. Please look at How to include third party libraries in React