Skip to content

Commit 3e78608

Browse files
committed
Fix failing build process
1 parent 06fc6de commit 3e78608

File tree

5 files changed

+108
-4
lines changed

5 files changed

+108
-4
lines changed

astro.config.mjs

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings";
99
import metaTags from "astro-meta-tags";
1010
import pagefind from "astro-pagefind";
1111
import deleteUnusedImages from "astro-delete-unused-images";
12-
import preload from "astro-preload";
1312
import { execSync } from "node:child_process";
14-
1513
import compress from "astro-compress";
1614

1715
let gitVersion = String(process.env.GIT_VERSION ?? "").slice(0, 7);
@@ -28,6 +26,44 @@ if (!gitVersion) {
2826
}
2927
}
3028

29+
function dontDie() {
30+
return {
31+
name: "dont-die",
32+
hooks: {
33+
"astro:config:setup": () => {
34+
const originalListeners = process
35+
.listeners("uncaughtException")
36+
.slice();
37+
process.on("uncaughtException", (error, origin) => {
38+
if (
39+
error.message &&
40+
error.message.includes("Failed to load remote image")
41+
) {
42+
console.warn(
43+
"[dont-die] Caught remote image error:",
44+
error.message
45+
);
46+
return;
47+
}
48+
49+
originalListeners.forEach((listener) => {
50+
if (typeof listener === "function") {
51+
try {
52+
listener.call(process, error, origin);
53+
} catch (listenerError) {
54+
console.error(
55+
"Error in uncaughtException listener:",
56+
listenerError
57+
);
58+
}
59+
}
60+
});
61+
});
62+
},
63+
},
64+
};
65+
}
66+
3167
// https://astro.build/config
3268
export default defineConfig({
3369
vite: {
@@ -81,7 +117,6 @@ export default defineConfig({
81117
"/speaker/savannah-ostrowski": "/speaker/savannah-bailey",
82118
},
83119
integrations: [
84-
preload(),
85120
mdx(),
86121
sitemap(),
87122
tailwind({
@@ -90,9 +125,10 @@ export default defineConfig({
90125
metaTags(),
91126
pagefind(),
92127
deleteUnusedImages(),
93-
(await import("astro-compress")).default({
128+
compress({
94129
SVG: false,
95130
}),
131+
dontDie(),
96132
],
97133
output: "static",
98134
build: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@astrojs/tailwind": "^5.1.5",
1919
"@fortawesome/fontawesome-free": "^6.7.2",
2020
"@tailwindcss/typography": "^0.5.16",
21+
"@unpic/astro": "^1.0.0",
2122
"astro": "^5.7.5",
2223
"astro-compress": "^2.3.8",
2324
"astro-delete-unused-images": "^1.0.3",

pnpm-lock.yaml

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/preloaded/.gitkeep

Whitespace-only changes.

public/images/404.png

7.76 KB
Loading

0 commit comments

Comments
 (0)