image icon indicating copy to clipboard operation
image copied to clipboard

'dir' not working in production mode with ipx

Open alex00888 opened this issue 3 years ago • 2 comments
trafficstars

My images are located in another directory, where I put them dynamically. I set 'dir' in config like this:

    image: {
        dir: process.env.IMAGES_PATH
    }

And it works fine when I run npm run dev. But when I build and run the production version, it shows an error: IPX Error: Error: File not found (/home/alex/projects/mattress/front/desktop/.output/public/storage/images/product/2/SZhJRoRZwTBRFiJ7PSBjm1wYhrfxE6qcetboss7s.webp) Why is it trying to find images in the .output directory?

I'm using Nuxt 3 and the latest version of @nuxt/image-edge.

alex00888 avatar Jul 17 '22 10:07 alex00888

Same issue, works in dev mode, but when deployed to cloudflare pages, the images are not shown. My images are also stored in the usual /assets/image directory. The docs are confusing as at one point they say you can change the dir as long as you specific in the nuxt config, but another part of the nuxt image docs say that if you are using default providers for local images you should store them in /public (not /static) .. I tried both options and neither work in production.

any ideas?

ricky11 avatar Sep 10 '22 03:09 ricky11

I know there are some issues when using directories other than the root public dir https://github.com/nuxt/image/issues/1006

blowsie avatar Feb 14 '24 12:02 blowsie