Skip to content
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

This is adorable and I love it but also I don't think the 404 handling for local/netlify dev images works #48

Open
leereamsnyder opened this issue May 14, 2021 · 0 comments

Comments

@leereamsnyder
Copy link

This is extremely NOT urgent please do not go out of your way to answer this.

I was playing around with this after I found it via CSS-Tricks and your tweet https://twitter.com/philhawksworth/status/1328340868726726656 about using Cloudinary and Netlify redirects, but with a 404 handler to re-serve local images as mentioned here https://twitter.com/philhawksworth/status/1328350104340848641.

But I'm not sure if it's working these days?

Reproduce

  1. Pull down this codebase
  2. npm install
  3. Add a new pet to pets.json along with a new image to src/images
  4. Run netlify dev

The new image 404s:

Screen Shot 2021-05-14 at 4 59 40 PM

I thought perhaps the netlify.toml needed to also account for the :height parameter in the requests, eg

[[redirects]]
  from = "/cloudinaried/:height/*"
  to = "/images/:splat"
  status = 404

But that didn't seem to work either.

Accessing the image directly when netlify dev is running at http://localhost:8888/images/the-new-doggo.jpg works as expected.

Has the syntax changed since this was originally written?

The idea of having 404s at Cloudinary fall back to the local, untransformed image is very appealing for local development and working with deploy previews, so I'm curious if I'm missing something here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant