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

Dev server has to be restarted to passthrough newly added image files #59

Open
NathanBowers opened this issue Mar 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@NathanBowers
Copy link

NathanBowers commented Mar 13, 2023

When adding a new image to a project Eleventy dev server has to be restarted for the new image to be served.

  • This is using .addPassthroughCopy("src/img/**/*.{png,gif,jpg,jpeg,pdf,svg,webp}"); in eleventy.js
  • Eleventy version: @11ty/[email protected]
  • Tried server with and without --incremental and it didn't help.

Reproduce:

  1. Have an eleventy project
  2. Add an image folder with some images
  3. Use addPassthroughCopy for those images to your config
  4. Create any html template that would render out an <img> element referencing one of the images in your project
  5. Start server
  6. View your template with <img> in web browser
  7. Add a new image file to your image folder
  8. Add a new <img> element to your html template referencing your newly added image file
  9. The new image will not be available and appears as a broken img src until the dev server is restarted
@zachleat zachleat added the bug Something isn't working label Jun 4, 2024
@zachleat
Copy link
Member

zachleat commented Jun 4, 2024

Successfully reproduced when using eleventyConfig.setServerPassthroughCopyBehavior("passthrough");

Works as expected with default behavior (eleventyConfig.setServerPassthroughCopyBehavior("copy");)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants