-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
@astrojs/image works locally but not on Vercel #5253
Comments
Fixed the build issue by installing Now the
Also, an image I have locally in the |
I’ve also seen reports of the image integration breaking down when using netlify |
Chatted with support and seems this is a known issue. Building locally to |
Looks like it may be an issue with how the Squoosh As a work around, if you're deploying to a NodeJS environment you should be able to install import image from '@astrojs/image'
export default defineConfig({
integrations: [
image({ serviceEntryPoint: '@astrojs/image/sharp' })
],
}); |
Closer! Most GET requests now timeout after 10 seconds. Oddly, 1/25 Cloudinary photos made it through. The local asset also times out.
|
@tycol7 btw, I'm having the same issue; I was working on an alternative Image component that allows for a local build and Vercel Remote Cache upload/download; this way the Remote Cache would be downloaded in CI (because it as been fully populated in a local build) and all the images will be there without an actual Btw:; How do you generate the Cloudinary link? Do you just copy the whole link from Cloudinary and use it in |
That'd be great - let me know how it goes!
I'm just getting the URL and passing that to a ---
import { v2 as cloudinary } from 'cloudinary';
import { Picture } from '@astrojs/image/components';
cloudinary.config({
cloud_name: import.meta.env.CLOUDINARY_CLOUD_NAME,
api_key: import.meta.env.CLOUDINARY_API_KEY,
api_secret: import.meta.env.CLOUDINARY_API_SECRET,
secure: true,
});
const cloudinary_search = await cloudinary.search
.expression('folder:tylerd-co')
.with_field('context')
.sort_by('uploaded_at', 'desc')
.execute();
const images = cloudinary_search.resources;
---
<main class="mt-24">
<div>
{
images.map((image: any) => (
<div class="mb-8">
<Picture
src={image.secure_url}
widths={[image.width / 4, image.width / 2, image.width]}
sizes={`(max-width): ${image.width} 100vw, ${image.width}`}
aspectRatio={image.aspect_ratio}
alt={image.context ? image.context.alt : "" }
/>
</div>
))
}
</div>
</main> |
I'm having a similar issue with render.com (image integration breaking) Is it related or do I need to create a new issue ? |
seems to only work when running |
The path generated in the code doesn't correspond to the path in of the assets |
Looking into this now to see if there's something we can do in the short term. |
Fixed in main, this should go out later today. |
Had to revert the fix to this as it broke other usages. Shouldn't take long to refix this though. |
Fixed in #5361 |
I forgot to give my component in Astro the format types for the remote images. After analysing the code, I found out that the AVIF format is the one which gets stuck/leads to the timeouts. So this is what works for me with almost no delay:
I have left out jpeg and avif from |
I have the same issue and I use |
Si their a fix for this one? |
This worked for me: https://docs.astro.build/en/reference/errors/missing-sharp/ |
@vintageplayer Yeah, because it does nothing :D If nothing happens, nothing can break :) 💯 astro/packages/astro/config.mjs Line 20 in 8118120
|
What version of
astro
are you using?1.6.1
Are you using an SSR adapter? If so, which one?
Vercel
What package manager are you using?
pnpm 7.14.1
What operating system are you using?
Mac
Describe the Bug
What
@astrojs/image
+ Cloudinary photo gallery builds locally but not in Vercel.Steps to reproduce
CLOUDINARY_CLOUD_NAME
,CLOUDINARY_API_KEY
, andCLOUDINARY_API_SECRET
in.env
npm run build
Initial thoughts
I understand
@astrojs/image
is still experimental. I don't think I'm using@astrojs/vercel/edge
in my project. Wondering if I'm doing something wrong or if this implementation is not yet supported.Thank you for any advice!
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-zugjfz?file=src/components/PhotoGallery.astro
Participation
The text was updated successfully, but these errors were encountered: