I created a create-react-app project using IntelliJ, and placed my index.html file in /public. When I preview /public/index.html using IntelliJ's option to do so, it appears just fine; all images, stylesheets, and JS files are present. However, upon going to localhost:3000 via npm start all tags are ignored, all tags are ignored, and every tag produces </p>
<blockquote>
<p>Uncaught SyntaxError "<"</p>
</blockquote>
<p>However, when I move the .css files, the .png/.jpg files, and the .js files into other folders, the <link>, <img>, and <script src> tags are immediately recognized this time after doing <strong>npm start</strong>, and I have absolutely no idea why.</p>
<p>Why is it that rearranging the location of files to change a tag in /public/index.html causes the page to properly display and function whereas it doesn't before whenever in a create-react-app project?</p>
<p>I fixed the issue, but I don't understand why my fix works, and I can't find anything online that tells me why this behavior occurs.</p>
<p>Thanks</p>
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)