nuxt / image

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

'dir' not working in production mode with ipx #573

Open alex00888 opened 2 years ago

alex00888 commented 2 years ago

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.

ricky11 commented 1 year ago

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?

blowsie commented 6 months ago

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