-
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
Unable to read static Image files in /public using IPX as provider on vercel, seeing [404] [IPX_FILE_NOT_FOUND] error #1281
Comments
Having similar issues but receiving |
Other developers report same issue here #1006 |
Same when deployed on Zeabur. |
Any new insights on this issue? Using |
Have anyone found any solution to this? but not sure why vercel looking for images in static directory? |
I gaved up, it still bug but try another inelegant way to fix.
If I am sure that image must is a internet image, I will use a Custom Provider like this. <NuxtImg provider="yourProvider" src="https://cloudflare.com/foo.jpg" /> If i am sure a image use static file. I will NOT set the provider attribute. <NuxtImg src="static/bar.jpg" /> If i don't know a image is internet or static, I will use <script lang="ts">
const imageUrl = ref<string>('static/baz.jpg') // This URL maybe change into a Internet image.
const isStaticImage = computed(() => imageUrl.value.startsWith('static/'))
</script>
<template>
<NuxtImg v-if="isStaticImage" :src="imageUrl" />
<NuxtImg v-else provider="yourProvider" :src="imageUrl" />
</template> |
Just my 2 cents, make sure the images aren't inside ClientOnly tags, as the NuxtImg is server-side only because it crawls the image references server side and based on that, it bundles the images during Removing ClientOnly tags fixed this same issue for me as I wrongly assumed NuxtImg can be used client side |
1. Issue
Unable to read static Image files in
/public
using ipx as provider on vercel, seeing[404] [IPX_FILE_NOT_FOUND]
error.This works in both local dev and production (Vercel) environment.
This only works in local dev environment and get [404] [IPX_FILE_NOT_FOUND] error in production (Vercel) environment.
This works in both local dev and production (Vercel) environment.
2. Using
3. Minimal Reproduction
Source Code: https://github.com/cfdxkk/nuxt-image-vercel-ipx
Online Demo: https://nuxt-image-vercel-ipx.vercel.app/
4. Something Maybe Useful
nuxt.config.ts
Vercel build command (nuxt default)
Source & Build Output in Vercel
Source
Build Output
The text was updated successfully, but these errors were encountered: