DEV Community

Cover image for How to fix security vulnerabillities in a newly created react app.
Heritier Akilimali
Heritier Akilimali

Posted on

2

How to fix security vulnerabillities in a newly created react app.

If you ever get error messages in the command line interface after creating a new react app with the create-react-app command, just like the image below, then this fix might help you out.

Image description

The first thing we do is deleting the starter files in the src path except the index.js and app.js files, ending up with the result in the below image.

Image description

The next step involves deleting every starter file in the public path except the index.html file just like below

Image description

In The next step, we will delete some code in the index.js file so that we don't have dependency imports that might trigger errors.

Image description

We will also delete some code in the index.html file to get rid of some of the deleted dependencies.

Image description

After you are finished with finding all the imports that are not used anymore and removing them, there should not be any more errors in the terminal. I hope this helped you out.
Thanks.

Top comments (0)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools canโ€™t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay