title: "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data" why?
body: <p>I get this error after of parsing json file. before parsing, it showed json file in output(tag p).</p>
  <p>index.js:</p>
  <pre><code>import React from &quot;react&quot;;
  import ReactDOM from &quot;react-dom&quot;;
  import text from &quot;./json.js&quot;;
  
  const cities = JSON.parse(text);
  
  class App extends React.Component{
      constructor(props) {
          super(props);
          this.state = {
              value: '',
              hint: ''
          }
      }
  
      handleChange = (e) =&gt; {
          this.setState({
              value: e.target.value
          });
  
      }
  
      render() {
          return (
              &lt;div&gt;
                  &lt;p&gt;{cities}&lt;/p&gt;
                  &lt;input value={this.state.value} placeholder={this.state.hint} onChange={this.handleChange}/&gt;
              &lt;/div&gt;
          );
      }
  }
  
  ReactDOM.render(&lt;App/&gt;, document.getElementById(&quot;root&quot;));
  </code></pre>
  <p>json.js:</p>
  <pre><code>(function getJson(){
      const xhttp = new XMLHttpRequest();
      xhttp.onload = function (){
          export const text = this.responseText;
          }
      xhttp.open(&quot;GET&quot;, &quot;./cities.json&quot;);
      xhttp.send();
  })()
  </code></pre>
  <p>cities.json:</p>
  <p><a href="https://www.uplooder.net/files/d5f677d8df6a69e6bd17dba5916ee4d0/cities.json.html" rel="nofollow noreferrer">https://www.uplooder.net/files/d5f677d8df6a69e6bd17dba5916ee4d0/cities.json.html</a></p>