image icon indicating copy to clipboard operation
image copied to clipboard

ipx server on 0.2.x

Open pkpowell opened this issue 4 years ago • 16 comments

The new alphas aren't spinning up an ipx server or generating any images from local dirs. Are changes to nuxt.config necessary to enable this (vs v0.0.4) or is one supposed to host ipx somewhere else? I'm using the stock prefs:

image: {
        static: {
            clearCache: false,
            cacheDir: "~~/node_modules/.cache/nuxt-img",
            dir: "~/assets/uploads",
            sharp: {}
        }
}

pkpowell avatar Jan 27 '21 08:01 pkpowell

I'm also struggling with this issue. Also trying to serve images from local static dir but not managing to get IPX to work as expected. Placeholders are only generated when using nuxt-picture but not when using nuxt-img on v.0.2.x, and with nuxt-picture it says type=image/webp but the actual webp image doesn't get generated, only the jpeg version.

Dawieking1 avatar Jan 27 '21 09:01 Dawieking1

Hi. Usage of hosted ipx with 0.2 is optional and via it's own provider. This is to make sure @nuxt/image remains a buildModule and IPX is properly/explicitly deployed on a server with enough resources (sometimes it is better if hosted separately and set via baseURL specially for serverless environments). Will update docs in short for this :)

Also please please notice image module is under development and opensourced to get early feedbacks but API is not stable yet so please do not use it for production.

pi0 avatar Jan 27 '21 10:01 pi0

Thank you for clarifying this.

Dawieking1 avatar Jan 27 '21 10:01 Dawieking1

Having it embedded works great with netlify when building automatically from a git repo, so it'd be really nice to still have that option.

pkpowell avatar Jan 27 '21 10:01 pkpowell

Hi @pkpowell Actually this option should remain when deploying to static hostings like Netlify via static provider :) I guess it is not working now since we have some regressions. Will keep issue posted.

pi0 avatar Jan 27 '21 10:01 pi0

Awesome, thanks.

pkpowell avatar Jan 27 '21 10:01 pkpowell

This should now be closed by https://github.com/nuxt/image/pull/257 - if using in production make sure to follow docs at https://image.nuxtjs.org/providers/ipx#using-ipx-in-production. Let me know if you still encounter issues and I'll reopen.

danielroe avatar Jun 04 '21 21:06 danielroe

@danielroe I still have problem with /static/images when deploy to netlify. The server can't found image /_ipx/.... I wanna use /_nuxt/ but follow the documentation that's seem not work.

vienpt avatar Jun 20 '21 16:06 vienpt

@danielroe I still have problem with /static/images when deploy to netlify. The server can't found image /_ipx/.... I wanna use /_nuxt/ but follow the documentation that's seem not work.

I'm running into the same issue. Any subdirectory pages, ie: /blog/page/2 won't load imagery. However root level pages, ie: /photography works fine.

tusamni avatar Jun 25 '21 18:06 tusamni

@tusamni @vienpt I'll look into it. Could you let me know what your image configuration is?

danielroe avatar Jun 25 '21 18:06 danielroe

@tusamni @vienpt I'll look into it. Could you let me know what your image configuration is?

Images are located in static/images/

Module config:

image: {
        staticFilename: '[publicPath]/images/[name]-[hash][ext]',
	dir: 'static/images'
    },

I'm loading them with a custom component from content like this;

<Photo
	src="/pages/home/eriksolsen.jpg"
	:width="2000"
	:height="3000"
	alt="The Mystery Spot - Santa Cruz, CA"
	classes="shadow-xl lg:rounded-md"
	sizes="xs:100vw lg:1024px"
	format="webp"
	:show="true"
/>

tusamni avatar Jun 25 '21 18:06 tusamni

@danielroe I still have problem with /static/images when deploy to netlify. The server can't found image /_ipx/.... I wanna use /_nuxt/ but follow the documentation that's seem not work.

the same issue for me too, is there any solution?

halilyuce avatar Jul 09 '21 13:07 halilyuce

@danielroe I still have problem with /static/images when deploy to netlify. The server can't found image /_ipx/.... I wanna use /_nuxt/ but follow the documentation that's seem not work.

I'm running into the same issue. Any subdirectory pages, ie: /blog/page/2 won't load imagery. However root level pages, ie: /photography works fine.

Have same issue

edjonusas avatar Jul 11 '21 14:07 edjonusas

same issue with 0.6.0

razbakov avatar Sep 24 '21 13:09 razbakov

Still getting this issue in 0.7.1. Images stored in my static folder are appearing in development but in production the _ipx/_/ image paths are giving 404s.

jackdishman avatar Jul 14 '22 11:07 jackdishman

I'm using version 0.7.0 and I still have the same issue. Both in production and in development

pabrul avatar Aug 02 '22 19:08 pabrul

I was having the same problem. When you deploy your application on Netlify and the build command is executed, for some reason the dist directory was not being generated on the Netlify server. I replace:

"build": "nuxt build" with "build": "nuxt build && nuxt generate".

The generate command works the same as the build command, but causes the dist to be generated. It worked for me!

victormedeiros1 avatar Feb 09 '23 02:02 victormedeiros1

having the same issue with nuxt 3. even trying to change the dir config for ipx it's trying to get ipx// but the images are present are the root folder.

Maybe the doc is not clear enough and what we should do ?

flozero avatar Aug 16 '23 04:08 flozero