title: "Cannot find module" when importing .csv file in Create React App
body: <p>I am trying to import a CSV for use with the D3 library to create a chart within a Create React App project, but importing the file is throwing a "Cannot find module" error even though the path to the CSV file is correct.</p>
  
  <p>I have a feeling this might be something to do with CRA's Webpack config under the hood but it looks like this is using the file loader so I'm not sure what the issue is. The data file is within CRA's src directory.</p>
  
  <p>The console log in the code below is running with the correct data in, which means the data must be being accessed. The error is thrown after this (Although the path to the CSV is underlined red in my editor).</p>
  
  <p>I am using TypeScript but I don't think this has anything to do with the problem.</p>
  
  <pre><code>import React from 'react';
  import * as d3 from 'd3';
  import CSVData from '../data/data.csv';
  
  const BarChart: React.FC = () =&gt; {
    d3.csv(CSVData).then(res =&gt; {
      console.log(res);
    });
    return &lt;div&gt;Test&lt;/div&gt;;
  };
  
  export default BarChart;
  </code></pre>