Deploy Troubles

I deployed my react-app on netlify successfully with no errors, yet none of the routes work. I only go as far as the landing page. (The login screen is not validated, just click the login button to proceed to the erroneous page)
Now I’ve searched a lot of topics on netlify community and stack overflow, tried many of the solutions, but none work.

My site: https://sales-force.netlify.app/

[build]
 command = "CI= npm run build" 
 publish="build/"

[[redirects]]
from = “/"
to = "/

status = 200

[[redirects]]
from = “/*”
to = “/index.html”
status = 200

[[redirects]]
from = “/*”
to = “/home”
status = 200

[[redirects]]
from = “/home”
to = “/*”
status = 200

[[redirects]]
from = “/*”
to = “/salesrep”
status = 200

[[redirects]]
from = “/salesrep”
to = “/*”
status = 200

[[redirects]]
from = “/*”
to = “/outlets”
status = 200

[[redirects]]
from = “/outlets”
to = “/*”
status = 200

[[redirects]]
from = “/*”
to = “/analytics”
status = 200

[[redirects]]
from = “/analytics”
to = “/*”
status = 200

[[redirects]]
from = “/*”
to = “/routes”
status = 200

[[redirects]]
from = “/routes”
to = “/*”
status = 200

[[redirects]]
from = “/*”
to = “/settings”
status = 200

[[redirects]]
from = “/settings”
to = “/*”
status = 200

I’ve tried adding a _redirects file in public folder but that didn’t work either. Tried changing from browserRouter to Hashrouter (it worked for another site i did)

Another things is, I get weird errors in the first route of the site. Here’s an image.

Any assistance will be greatly appreciated. Apologies if my question is duplicate.

hi there! can you first confirm that all of your redirects are being processed?

All of them are being processed successfully

hmm! one more thing to try and give a read through:

if not, please post again, and we’ll try and troubleshoot.

I’ve read the post, I’ve tried the solutions there,…I even added a _redirects file in the public folder with the syntax in the post, but nothing, tried to update react scripts to no avail as well. My build folder on netlify shows both the netlify.toml and the _redirects file properly in there. At this point, I really don’t know what the issue could be… I have no idea.

So I found the solution.

The issue was

  1. I saved my _redirects file as a txt in the public folder, as soon as I removed the .txt extension, the routes were being read correctly.
  2. Even though the routes were working after the changing the _redirects file, the console was showing a minified error #321 - Something about having duplicate versions of react and breaking react hooks. Even though the error was not showing locally, it appeared after the deploy. The issue came about because I have a UI package (mdbreact) whose latest version is tending to duplicate my react, anyway long story short, I tried downgrading my react and react-dom version as well as the mdbreact version, all to an older version, and it worked.

Thanks for the help and ideas… Appreciated.

1 Like

glad it is working, and thanks for posting your solution!