title: How to fix absolute path setting error in React?
body: <p>I am trying to create a project with react.</p>
  <p>I created jsconfig.json in the React Rootfolder and set the absolute path, but this error appears.</p>
  <p><strong>How to solve it?</strong></p>
  <p><a href="https://i.stack.imgur.com/L69J2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L69J2.png" alt="enter image description here" /></a></p>
  <p>This is your project folder.</p>
  <pre><code>// jsconfig.json
  {
      &quot;compilerOptions&quot;: {
        &quot;baseUrl&quot;: &quot;src&quot;
      },
      &quot;include&quot;: [
        &quot;src&quot;
      ]
  }
  </code></pre>
  <pre><code>// package.json
  &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-scripts start&quot;,
      &quot;build&quot;: &quot;react-scripts build&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;
    },
    &quot;eslintConfig&quot;: {
      &quot;extends&quot;: [
        &quot;react-app&quot;,
        &quot;react-app/jest&quot;
      ]
    },
    &quot;browserslist&quot;: {
      &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
      &quot;development&quot;: [
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
      ]
    },
  </code></pre>
  <p>I created the project with CRA.</p>
  <blockquote>
  <p>Module not found: Error: Can't resolve 'Views/Welcome' in
  '/Users/my-app/src' Did you
  mean './Views/Welcome'? Requests that should resolve in the current
  directory need to start with './'. Requests that start with a name are
  treated as module requests and resolve within module directories
  (node_modules, /Users/my-app/node_modules). If changing the source code is
  not an option there is also a resolve options called 'preferRelative'
  which tries to resolve these kind of requests in the current directory
  too.</p>
  </blockquote>
  <pre><code>// App.jsx
  import './styles/App.scss';
  import {Route, Routes} from 'react-router-dom';
  import Welcome from 'Views/Welcome'
  import Visit from 'Views/Visit';
  function App() {
    return (
      &lt;div className=&quot;App&quot;&gt;
        &lt;Routes&gt;
          &lt;Route exact path = '/' element={&lt;Welcome /&gt;}/&gt;
          &lt;Route exact path = '/visit' element={&lt;Visit /&gt;}/&gt;
        &lt;/Routes&gt;
      &lt;/div&gt;
    );
  }
  
  export default App;
  </code></pre>
  <p>My react and node version is &quot;node&quot;: &quot;^17.5.0&quot;,
  &quot;react&quot;: &quot;^17.0.2&quot;.</p>