title: Module not found: Can't resolve './serviceWorker' while using React Router
body: <p>I got this error : Module not found: Can't resolve './serviceWorker' in '/home/radu/Desktop/ReactAppStudents/barbut/src'</p>
  <p>Here is my index.js file.</p>
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import App from './App';
  import * as serviceWorker from &quot;./serviceWorker&quot;;
  import { BrowserRouter as BrowserRouter} from &quot;react-router-dom&quot;;
  
  
  ReactDOM.render(
    &lt;BrowserRouter&gt;
      &lt;App /&gt;
    &lt;/BrowserRouter&gt;,
    document.getElementById('root')
  );
  
  //reportWebVitals();
  serviceWorker.unregister();
  </code></pre>
  <p>And here is my App.js where I'm trying to use React Router.</p>
  <pre><code>import React from 'react';
  import {BrowserRouter , Switch, Route } from &quot;react-router-dom&quot;;
  
  import Login from &quot;./Login&quot;;
  import SignUp from &quot;./SignUp&quot;;
  
  function App() {
    return (
    &lt;div&gt;
      &lt;BrowserRouter&gt;
        &lt;Switch&gt;
          &lt;Route exact path={&quot;/&quot;} component={() =&gt; &lt;h1&gt;Index&lt;/h1&gt;} /&gt;
          &lt;Route path={&quot;/login&quot;} component={()=&gt; &lt;h1&gt;Login&lt;/h1&gt;} /&gt;
          &lt;Route path={&quot;/home&quot;} component={&lt;h1&gt;Home&lt;/h1&gt;} /&gt;
          &lt;/Switch&gt;
      &lt;/BrowserRouter&gt;
      &lt;/div&gt;
    );
  }
  
  export default App;
  </code></pre>