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

232
Views
React - Doesn't work refreshing page on react app

I am building front-end of marketplace using react. "react": "^17.0.2" "react-redux": "^7.2.5" "react-scripts": "4.0.3" @reach/router": "^1.3.4"

After built the app on local or netlify, when refreshing page(F5), it doesn't work and it returns blank page. In details, "404: The requested path could not be found" on local, and then blank page with console error on netlify.

But, it does work well on local dev(yarn start) and from clicking menu after built.

I had already tried to add "homepage":"." on package.json and _redirects file with /* /index.html 200 on root and build folder.

I am not sure whether it is build setting problem or @reach/router issue.

How can I fix this issue?

Hope to your quick help.

Thank you,

PS: Attached my issue screenshots.

Error on local

Error on netlify

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

create a .htaccess file in the public directory of your react project and paste the text below.

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

When built again and re-uploaded it should not have an error on reload.

about 4 years ago · Juan Pablo Isaza Report
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!