Throws error in vercel & also in cloudflare
JojokCreator opened this issue · comments
When building a static site on Vercel I'm getting an error thrown
21:11:35.912 | free(): invalid size
21:11:35.912 | free(): invalid size
and sometimes it just freezes after generating optimized images
I've tried
compress({ Image: false }),
But still no luck.
I also tried on cloudflare but the same error. Builds okay locally.
Heck, can you try replacing Path
with just:
export default (await import("astro/config")).defineConfig({
integrations: [
(await import("astro-compress")).default({
Path: ["./dist"],
}),
],
}) as typeof defineConfig;
import type { defineConfig } from "astro/config";
The support for Astro's default image compression directory has been added in the latest 2.2.9 -> _astro
to remove it just try the above.
(await import("astro-compress")).default(
{
Path: ["./dist"],
},
),
This seems to fix the error. But it's still resizes all the images when I add { Image: false }
(await import("astro-compress")).default(
{
Path: ["./dist"],
},
{ Image: false }
),
(await import("astro-compress")).default( { Path: ["./dist"], }, ),
This seems to fix the error. But it's still resizes all the images when I add { Image: false }
(await import("astro-compress")).default( { Path: ["./dist"], }, { Image: false } ),
Do:
(await import("astro-compress")).default({
Path: ["./dist"],
Image: false,
}),
Perfect thanks.
Sorry...
it's back again using the config above on both vercel and cloudflare.
generating optimized images
--
09:09:54.680 | free(): invalid size
09:14:20.856 | Error: Command "npm run build" exited with SIGABRT