unpic-img
unpic-img copied to clipboard
[Astro] Images not found after build
Using unpic with Astro breaks after running build. In dev all images are loaded and the placeholders are working but after building the images are not served anymore.
Path after build: http://localhost:4321/_image?w=1920&h=1280&fit=cover&href=%2F_astro%2F8.B51ZUIHt.jpg
The images are in ./src/assets/images
Astro config
import { imageService } from "@unpic/astro/service";
[...]
image: {
service: imageService(),
},
[...]
Image component (dynamically imported images using import.meta.glob())
import { Image } from "@unpic/astro";
[...]
const placeholder = blurhashToCssGradientString(blurHashes[index]);
[...]
<Image
src={imageData.default.src}
width={imageData.default.width}
height={imageData.default.height}
alt="Photo by XYZ"
class="w-full h-auto object-cover rounded-xl"
placeholder={placeholder}
/>
[...]
Could you create a reproduction? Easiest is if you use https://astro.new/repro/