nuxt / image

Plug-and-play image optimization for Nuxt applications.
https://image.nuxt.com
MIT License
1.32k stars 268 forks source link

[nuxt3] Static image prerendering endless loop #662

Open brunodeangelis opened 1 year ago

brunodeangelis commented 1 year ago

See reproduction: https://github.com/brunodeangelis/nuxt3-image-endless-loop

Static prerendering introduced in #614 seems to be generating an endless loop when running yarn generate. This seems to be associated in some way with the format option Screenshot 2022-11-24 at 18 18 52

If I let it run, it just keeps creating more and more directories as seen here: Screenshot 2022-11-24 at 18 21 45

Any help appreciated, thank you

Triloworld commented 1 year ago

Can you provide on https://stackblitz.com/ minimal reproduction and share there? Everyone can help better

brunodeangelis commented 1 year ago

Can you provide on https://stackblitz.com/ minimal reproduction and share there? Everyone can help better

Sorry, StackBlitz won't let me upload files to the public directory since I need a paid plan. I also tried making an extremely barebones local example to push to github and link here, but I'm actually getting error #660. Maybe these two are related?

brunodeangelis commented 1 year ago

@Triloworld I just pushed a reproduction repo for you to check. Some instructions in the README. Thank you. https://github.com/brunodeangelis/nuxt3-image-endless-loop

Tuuuukka commented 1 year ago

Happens for me too, although it's not endless. But it's still folder after folder after folder after folder and so on.

  image: {
    presets: {
      test: {
        modifiers: {
          format: 'jpg',
          width: 60,
          height: 60
        }
      }
    }
  }

and

<nuxt-img src="/testimage.jpg" preset="test" />

renders as

<img src="/_ipx/f_jpg,s_60x60/testimage.jpg">

and results in the loop mentioned. It doesn't matter if the image exists anywhere or not, using custom dir makes no difference and changing the format has no effect.