From 1957fd0ff6f789583ea9eaf9c4e29a3bf728e9f5 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 14 May 2025 22:59:02 +0200 Subject: [PATCH] fix(init): must use urls for asset copying (#2946) Second attempt to fix https://github.com/denoland/fresh/pull/2943 . Turns out that `import.meta.dirname` is `undefined` when served from JSR. I'm not able to reproduce that error locally though. Fixes https://github.com/denoland/fresh/pull/2943 --- init/src/init.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/src/init.ts b/init/src/init.ts index 484e09ae..5996f206 100644 --- a/init/src/init.ts +++ b/init/src/init.ts @@ -395,7 +395,7 @@ ${GRADIENT_CSS}`; await writeFile( "static/favicon.ico", await Deno.readFile( - path.join(import.meta.dirname!, "assets", "favicon.ico"), + new URL(import.meta.resolve("./assets/favicon.ico")), ), );