Skip to content

Commit fc7dc9a

Browse files
author
Nathan Booker
committed
Fix TypeScript compilation errors with Vercel cache API
- Remove invalid generic type parameter from cache.get<CacheEntry>() call - Add proper type assertion for cache.get() return value - Resolve type mismatch issues in cache entry handling functions
1 parent 86d37ee commit fc7dc9a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.4.1] - 2025-01-03
6+
7+
### Fixed
8+
- Fixed TypeScript compilation errors with Vercel cache API
9+
- Removed invalid generic type parameter from `cache.get<CacheEntry>()` call
10+
- Added proper type assertion for cache.get() return value
11+
- Resolved type mismatch issues in cache entry handling functions
12+
513
## [0.3.1] - 2025-01-03
614

715
### Added

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export async function cachedFetch(
313313
try {
314314
// Try to get from cache first
315315
if (cacheOption === 'force-cache' || cacheOption === 'auto no cache') {
316-
const cachedEntry = await cache.get<CacheEntry>(cacheKey);
316+
const cachedEntry = await cache.get(cacheKey) as CacheEntry | undefined;
317317

318318
if (cachedEntry && !isCacheEntryExpired(cachedEntry)) {
319319
// Check if we need to revalidate in the background

0 commit comments

Comments
 (0)