From e56016a5b213a5d117c74e7bc32fdd2ecf4c6274 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Fri, 6 Mar 2026 06:14:59 +0100 Subject: [PATCH] fix: resolve __APP_VERSION__ type error in svelte-check Move the global type declaration inside declare global block and reference the constant via a local variable in the script block. Co-Authored-By: Claude Opus 4.6 --- src/app.d.ts | 4 ++-- src/routes/+layout.svelte | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app.d.ts b/src/app.d.ts index 9baa333..aea9d01 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,8 +1,8 @@ // See https://svelte.dev/docs/kit/types#app.d.ts // for information about these interfaces -declare const __APP_VERSION__: string; - declare global { + const __APP_VERSION__: string; + namespace App { // interface Error {} // interface Locals {} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 7f8e329..7a4691c 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -6,6 +6,8 @@ import { loadNotes } from '$lib/stores/notes.js'; import { onMount } from 'svelte'; + const appVersion = __APP_VERSION__; + let { children } = $props(); let sidebarOpen = $state(false); @@ -25,7 +27,7 @@
- Crumbs by Bretzel v{__APP_VERSION__} — made with 🥨 in Strasbourg + Crumbs by Bretzel v{appVersion} — made with 🥨 in Strasbourg