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

ipx server on 0.2.x #165

Open
pkpowell opened this issue Jan 27, 2021 · 18 comments
Open

ipx server on 0.2.x #165

pkpowell opened this issue Jan 27, 2021 · 18 comments

Comments

@pkpowell
Copy link

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: {}
        }
}
@Dawieking1
Copy link

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.

@pi0
Copy link
Member

pi0 commented Jan 27, 2021

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.

@Dawieking1
Copy link

Thank you for clarifying this.

@pkpowell
Copy link
Author

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.

@pi0
Copy link
Member

pi0 commented Jan 27, 2021

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.

@pkpowell
Copy link
Author

Awesome, thanks.

Copy link
Member

This should now be closed by #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.

@vienpt
Copy link

vienpt commented Jun 20, 2021

@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.

@tusamni
Copy link

tusamni commented Jun 25, 2021

@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.

@danielroe
Copy link
Member

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

@danielroe danielroe reopened this Jun 25, 2021
@tusamni
Copy link

tusamni commented Jun 25, 2021

@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"
/>

@halilyuce
Copy link

@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?

@edjonusas
Copy link

@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

@razbakov
Copy link

same issue with 0.6.0

@jackdishman
Copy link

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.

@pabrul
Copy link

pabrul commented Aug 2, 2022

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

@victormedeiros1
Copy link

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!

@flozero
Copy link
Contributor

flozero commented Aug 16, 2023

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests