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

Nuxt Picture with format fallback does not render the avif format but webp #1630

Open
Baroshem opened this issue Dec 12, 2024 · 1 comment
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Baroshem
Copy link
Collaborator

I'm using NuxtPicture with format="avif,webp" and ipx. When I test the page in npm run dev, the image type in Network tab is correct: image/avif. However, when I run npm run generate and serve the build, the images in Network tab have the content type image/webp which is the original content type of my source image.

I see the image is served from a correct avif folder:
GET /_ipx/w_400&f_avif/images/blog/1-front-panels-tips/01-front-matter.webp

I tried putting this in my nuxt config:

image: {
    provider  : "ipx",  // the default
    format    : ['avif', 'webp'],
    ipx       : {
      modifiers : {
        format  : 'avif'
      }
    }
  },

but the content type after generate is still image/webp.

I'm using @nuxt/[email protected]

Originally posted by @arxwtf in #1345 (comment)

@Baroshem
Copy link
Collaborator Author

@danielroe Am I correct thinking that for nuxt generate, we cannot distinguish what kind of format extension does the browser provide (the most performant one) so we use webp by default?

And this format fallback would only work fully on SSR apps?

@Baroshem Baroshem added bug Something isn't working help wanted Extra attention is needed labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant