Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix(types): bound dynamic scoped fetch inference

Timothy Yin2384831f573c
diff --git a/packages/gallery/app/composables/useEntryApi.ts b/packages/gallery/app/composables/useEntryApi.ts
index db60680c..fef95b7d 100644
--- a/packages/gallery/app/composables/useEntryApi.ts
+++ b/packages/gallery/app/composables/useEntryApi.ts
@@ -2,7 +2,11 @@ import { useEntryContext, entryRequestPath } from './useEntryContext'
/** Bind to the creating scope; delayed handlers must never target a different Site/account. */
export function useEntryApi(baseURL: string) {
const context = useEntryContext()
- const fetcher = useRequestFetch() as typeof $fetch
+ // Scoped paths are dynamic; avoid instantiating Nitro's route matcher here.
+ const fetcher = useRequestFetch() as (
+ request: string,
+ options: Record<string, unknown>,
+ ) => Promise<unknown>
const snapshot = context.value
return (async (request: string, options?: Record<string, unknown>) => {
if (context.value?.scope !== snapshot?.scope)