DEV Community

Phillip Powell
Phillip Powell

Posted on

create-react-app project refuses to recognize <script src>, <link> and <img> HTML tags

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 &quot;&lt;&quot;</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&#39;t before whenever in a create-react-app project?</p> <p>I fixed the issue, but I don&#39;t understand why my fix works, and I can&#39;t find anything online that tells me why this behavior occurs.</p> <p>Thanks</p>

Top comments (0)