netlify dev with the following redirects rule on create-react-app (latest version 3.4.1) causes all requests to the /static dir to be redirected to /index.html.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
This causes e.g. the /static/bundle.js to return the index.html causing a syntax error as shown in screen shot of dev tools:
The only way Iβve been able to solve it so far is to add a redirect rule for /static/* to /static/:splat above the existing rule i.e.
[[redirects]]
from = "/static/*"
to = "/static/:splat"
status = 200
This seems wrong, weirdly there is no issue on live .netlify.com url. Only netlify dev. Am running version 2.40.0 of netlify-cli.
This is really weird but I just commented out my /static redirect and itβs working now. No idea why as havenβt changed anything else and restarted netlify dev multiple times when before raising the issue.
I also have this issue and have been unable to fix it without the hacky redirect rule. Also have to shift-reload every load (to clear cache?) if using netlify dev. Without doing so my app just renders empty html.
Hi, @bradleygriffith and @bristoljon. I am able to reproduce this as well and Iβve filed an issue for this here:
This topic and issue are cross-linked. It is a public repo so please feel free to watch the issue there. Weβll also post an update here if/when the issue is known to be resolved.