-
Notifications
You must be signed in to change notification settings - Fork 270
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 provider not working properly when the default provider is not IPX #1414
Comments
I have a very similar issue, I'm trying to instantiate 2 ipx instances but only one is ever setup With a bit of debug, that's because the providerSetup is made using the name of the provider instead the
Your issue is part of this because there is some hardcoding to setup ipx
I'll solve it in the same PR |
I also cant use ipx as a secondary provider. I use cloudflare as my main provider for images hosted on Cloudflare Images but I want to use ipx occasionally for static images: Nuxt config:
Component: <NuxtImg src="/static-image.jpg" provider="ipx" /> Error:
Did you guys find a workaround? |
I found this out recently as well. If I have this in my nuxt.config: image: {
provider: import.meta.env.NUXT_PUBLIC_IMAGE_PROVIDER,
} it doesn't matter what I set that env var to - If I do this instead: image: {
provider: import.meta.env.NUXT_PUBLIC_IMAGE_PROVIDER || 'ipx',
} then that seems to signal to the production build that ipx is needed, and then it seems to actually install what's necessary to have ipx running on the built production server. |
Is there any news on this? @danielroe |
Same issue for me, I want to default to |
If anyone wants to make a PR for this, feel free, just fixing this particular issue wouldn't take a huge change, as it's only necessary to change the condition for setting up IPX I mentionned, maybe just checking if |
I have custom provider (thumbor) as my default provider in the config and in some case I still need IPX provider, so I pass provider props in the
NuxtImg
components as<NuxtImg provider="ipx" />
and the result is 404._ipx
path is not found.The config I had:
When I omit the
ipx
property, it throwUnknown provider: IPX
error. The config works when I replace the default provider withipx
.Is it expected behavior?
I create a minimal reproduction using
ipx
andunsplash
provider to suit my problem: https://stackblitz.com/edit/nuxt-image-ipx-repro?file=app.vueThank you!
The text was updated successfully, but these errors were encountered: