0

I am at a loss... I have tried so many different things but can not get this to work right.

Regardless if I run the Build or if Heroku runs the build, something weird is happening with the Public folder in my react app.

Everything works really well in the local server. But things are not working the right way when I launch it to Heroku -

First, I was storing my background Image for the home page in the public folder - It worked in the local server but not when I launched it to Heroku.

The Favicon also will not work in the heroku launch.

Lastly, it also wont register my routes. Locally I can go to /admin, but when launched to Heroku, it gives me a 503 error.

Not quite sure what code to include here - I am thinking maybe it has something to do with git? Not sure!

Thanks for your help!

Here is the Heroku Log ---

2020-07-03T23:26:06.755835+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/aaaa" host=www.brianpruzzo.com request_id=1d6e5d13-5464-4ca5-8965-8e70aa5fa915 fwd="77.255.15.191" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https

2020-07-03T23:26:13.767848+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/manifest.json" host=www.brianpruzzo.com request_id=f218a673-5a9a-484c-9fe9-002689f69f9f fwd="77.255.15.191" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https

Nick McLean
  • 601
  • 1
  • 9
  • 23
  • Can you access the files directly from heroku, such as myApp.heroku.com/favicon.ico? – Adam Jeliński Jul 03 '20 at 23:04
  • No I can not - Though I am trying with a custom domain name. www.brianpruzzo.com/favicon.ico - Hold up for a sec I am messing with this... – Nick McLean Jul 03 '20 at 23:15
  • https://www.brianpruzzo.com/ – Nick McLean Jul 03 '20 at 23:16
  • Okej, so for some reason all of the unprocessed files and custom routes throw errors. Does the `heroku logs --tail` command provide any useful information about the errors, that you could post? – Adam Jeliński Jul 03 '20 at 23:26
  • Posting above ! – Nick McLean Jul 03 '20 at 23:29
  • Do you find it weird that the path is /aaaa for that first error? I assume that's the error for the route /admin... (which is the only route on the page that links to another page) – Nick McLean Jul 03 '20 at 23:35
  • The /aaaa is just me trying to figure out what is wrong :). I was hoping to get a 404, but was disappointed not to get anything. The only useful piece of information here seems to be the heroku H12 code. According to the docs, it means that your app took more than 30 seconds to process the request. Are you using a custom backend script or something similar that could get terribly stuck? – Adam Jeliński Jul 03 '20 at 23:41
  • I don't beleive so - It has been weird since I started this project. I can post the server file? – Nick McLean Jul 03 '20 at 23:46
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/217186/discussion-between-nick-mclean-and-adam-jelinski). – Nick McLean Jul 03 '20 at 23:48
  • Whats up @AdamJeliński! Hope things are going well for you! Do you have any experience with NGINX servers? https://stackoverflow.com/questions/65480401/websocket-cloudflare-with-nginx-520-error – Nick McLean Dec 28 '20 at 16:15

1 Answers1

1

Alright! After a while I finally figured out the issue... be sure to check that the static route in your express server comes before your other routes. Better yet... use a router.... Agh! It got me.

Nick McLean
  • 601
  • 1
  • 9
  • 23