Skip to content

Commit ffd7cdd

Browse files
fix(init): fetch favicon from network like before (#2948)
Reverts back to fetching the favicon from the network. Copying assets from JSR turns out to be difficult. Fixes #2941
1 parent 638a98b commit ffd7cdd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

init/src/init.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,14 @@ ${GRADIENT_CSS}`;
392392
<path d="M14.297 16.49c.985-.747 1.644-1.01 2.099-2.526.566.121.841-.08 1.29-.701.324.466 1.657.608 2.453.701-.715.451-1.057.852-1.452 2.106-1.464-.611-3.167-.302-4.39.42Z" fill="#fff"/>
393393
</svg>`;
394394
await writeFile("static/logo.svg", STATIC_LOGO);
395-
await writeFile(
396-
"static/favicon.ico",
397-
await Deno.readFile(
398-
new URL(import.meta.resolve("./assets/favicon.ico")),
399-
),
400-
);
395+
396+
try {
397+
const res = await fetch("https://fresh.deno.dev/favicon.ico");
398+
const buf = await res.arrayBuffer();
399+
await writeFile("static/favicon.ico", new Uint8Array(buf));
400+
} catch {
401+
// Skip this and be silent if there is a network issue.
402+
}
401403

402404
const MAIN_TS = `import { App, fsRoutes, staticFiles } from "fresh";
403405
import { define, type State } from "./utils.ts";

0 commit comments

Comments
 (0)