mars / create-react-app-buildpack

⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
MIT License
3.28k stars 653 forks source link

With static.json, got 500 error for both favicon.ico and client routing paths #142

Closed just4fun closed 6 years ago

just4fun commented 6 years ago

I created static.json per document as below.

{
  "root": "build/",
  "routes": {
    "/**": "index.html"
  }
}

However, I got following errors.

500
  1. /automation-tool is one of the route created by react router
  2. favicon.ico is located in same level of index.html in build/ folder. Moreover, as the pic above, the favicon.ico has been treated as text/html

Any configuration I missed? Currently I'm using create-react-app@2.1.1.

mars commented 6 years ago

Hi @just4fun 😁

When those 500 errors are returned, what is logged by the Heroku app? Please tail the logs and paste the result here:

heroku logs -t

That should indicate the problem.

just4fun commented 6 years ago

Hey @mars

It's very weird that when I add static.json back to my project then force push to heroku again, everything works well. Last weekend I did same thing but had no luck.

Anyway, thanks.