diff --git a/package-lock.json b/package-lock.json index 8859a85..6df6826 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,6 +58,7 @@ "@scure/bip32": "^2.0.1", "@scure/bip39": "1.6.0", "@tanstack/query-core": "^5.102.8", + "@tanstack/query-persist-client-core": "^5.102.8", "@tanstack/react-query": "^5.56.2", "@tanstack/react-query-persist-client": "^5.102.8", "@unhead/addons": "^2.0.10", @@ -3533,6 +3534,16 @@ "type": "github" } }, + "node_modules/@tanstack/query-persist-client-core": { + "version": "5.102.8", + "resolved": "https://registry.npmjs.org/@tanstack/query-persist-client-core/-/query-persist-client-core-5.102.8.tgz", + "integrity": "sha512-t3v4/D6ejo/BrPzM5gm/AT3c4CWPCxFa+0cIjAeHAeanGPG6rCjFS1hZnPZH/rf55qe3qYYgx5U6iBZMY1PQjA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/tannerlinsley", + "type": "github" + } + }, "node_modules/@tanstack/react-query": { "version": "5.75.1", "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.75.1.tgz", diff --git a/package.json b/package.json index 200c289..0361711 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "@scure/bip32": "^2.0.1", "@scure/bip39": "1.6.0", "@tanstack/query-core": "^5.102.8", + "@tanstack/query-persist-client-core": "^5.102.8", "@tanstack/react-query": "5.102.8", "@tanstack/react-query-persist-client": "5.102.8", "@unhead/addons": "^2.0.10", diff --git a/src/hooks/useCVMClient.ts b/src/hooks/useCVMClient.ts index 580b3e8..91c055f 100644 --- a/src/hooks/useCVMClient.ts +++ b/src/hooks/useCVMClient.ts @@ -362,7 +362,7 @@ export function useCVMClient() { // Collapse the same real-world spot re-posted under a different id/author // (coordinate dedupe above can't catch those). Keeps the freshest copy. - spots = deduplicateByIdentity(spots as typeof spots & { tags: string[][]; created_at: number }[]); + spots = deduplicateByIdentity(spots); if (params.difficulty && params.difficulty !== 'all') { spots = spots.filter( diff --git a/src/lib/queryPersister.ts b/src/lib/queryPersister.ts index 5ae256d..64934cb 100644 --- a/src/lib/queryPersister.ts +++ b/src/lib/queryPersister.ts @@ -27,10 +27,14 @@ */ import { get, set, del } from 'idb-keyval'; +// PersistedClient / Persister are defined in the persist-client CORE package. +// The React wrapper (@tanstack/react-query-persist-client) only re-exports them +// via `export *`, which tsc does not resolve for named *type* imports under +// this project's config — import them from the canonical source instead. import type { PersistedClient, Persister, -} from '@tanstack/react-query-persist-client'; +} from '@tanstack/query-persist-client-core'; import type { Query } from '@tanstack/react-query'; const IDB_KEY = 'skatespots:react-query-cache';