Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
react public folder images suddenly dont work

I have many images and audios in my react project using create-react-app and thus Im using the public folder to use the images in my components. Yesterday night all the images where displayed correctly, and even displayed in github pages worked. But it just stopped working locally today. Ive tried updating packages, checking out in git to see if the problem were not there in previous commits, but none of that worked. Idk if it has something to do with npm packages or if you have encountered this problem before. Thank yoou

I just pushed to github the code and the images look good

enter image description here

and with the same code in localhost

enter image description here

The images are downloaded properly in localhost but it says type text/html instead of the extension of the image

enter image description here

Edit

It turns that the homepage attribute of the package.json changed the path of the localhost, although it rendered without that path, ant thus all the previous paths got messed up, use process.env.PUBLIC_URL to prevent this type of errors if using public folder

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!