-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
200 redirect rules are treated as force=true (local file shadowing not working) #851
Comments
Unfortunately this seems to still be not solved. I'm still getting the same behaviour (redirects when the real site exists) with |
@j-o-sh Can you elaborate please! Can you please show us your |
Hi @RaeesBhatti So after a bit of digging around I think it has something to do specificallyt with redirects to functions. In the redirect in the [build]
command='npm run build'
publish='dist/site'
functions='dist/functions/'
[dev]
framework='#static'
publish='dist/site'
[[redirects]]
from='/wishes.mine/*'
#to='/?x=:splat'
to='/.netlify/functions/wishes_render_mine?key=:splat'
status=200
|
I did manage to isolate the problem in a very simple repo. Check out this repo. The problem is reproduced there. |
Hi there, Would it be helpful to create a new ticket with those findings? Or would you rather like to reopen this ticket? Do you already have an idea what could cause this? Sorry if I'm being intrusive. |
Hi, Sorry for the delay. I see you already closed the issue again, which is fine I guess. ;) ...I am a bit puzzled however as to how I can try out that branch as you suggested? Can I somehow |
Ok, I kinda hacked it to get it to work... But yay the fix holds 👍 👯 thx so much. |
- Do you want to request a feature or report a bug?
This is a bug report for the
netlify dev
handling of 200 redirect rules.- What is the current behavior?
When
netlify dev
processes a 200 redirect it will always redirect even if the local file/asset exists. This is particularly problematic for the SPA rule below:The 200 redirect should only occur for URLs with no static file for that URL.
- If the current behavior is a bug, please provide the steps to reproduce.
You can clone this repo to test (which wasn't created for this purpose - sorry about the name).
https://github.com/overlordofmu/nlm-fake-ssg-site-NO-NLM
Reproduction steps follow.
Click on the
https://localhost:8888
link.Open dev tools, click on the network tab, refresh the page. Note, the file
large.jpg
exists butindex.html
is served.You can see this with
curl
also:The contents of index.html are being sent in place of the actual image.
- What is the expected behavior?
The 200 redirect should only occur for assets which are not present in the publish directory.
- Local Environment Information
The text was updated successfully, but these errors were encountered: