image icon indicating copy to clipboard operation
image copied to clipboard

Optimized images generated in local env well. but in build env, lost optimized images. Are there any solutions?

Open manalab17 opened this issue 3 years ago • 2 comments

I use nuxt ver 2.14.7 and @nuxt/image 0.6.0 for my application.

my nuxt.config.js

  target: 'static',
  image: {
    provider: 'static',
  }

vue file

              <nuxt-img :src="origin image link"
                        provider="static"
                        width="270px"
                        height="270px"
                        alt=""/>

It worked well in local env, but when I run build, optimized images losted.

And requested url is "~~~/_ipx/s_270x270/images/airports/LAX.jpg"

I want to display optimized images with static provider.

Did I miss any attributes? or Are there any solutions?

manalab17 avatar Jul 12 '22 02:07 manalab17

We're getting the same issue with nuxt 2.15.8, @nuxt/image0.6.2 node 16.16.0, linux OS. Had to use an alias as we were getting IPX Error: TypeError: Only absolute URLs are supported on production but the images are not optimised. We've tried the serverMiddleware from https://image.nuxtjs.org/providers/ipx#advanced-custom-servermiddleware but the images still aren't optimising.

ellie-jones avatar Jul 14 '22 10:07 ellie-jones

Update: downgrading to @nuxt/image 0.5.0 fixed the optimisation

ellie-jones avatar Jul 14 '22 11:07 ellie-jones