diff --git a/src/cache/fetchWithCache.ts b/src/cache/fetchWithCache.ts index e4477b0..3ebb9e8 100644 --- a/src/cache/fetchWithCache.ts +++ b/src/cache/fetchWithCache.ts @@ -34,6 +34,13 @@ export function getDefaultHandler() { prefix: 'next-cachex', }); } catch (error) { + if (process.env.NODE_ENV !== 'test') { + // eslint-disable-next-line no-console + console.warn( + 'Failed to initialize Redis backend, falling back to memory:', + error instanceof Error ? error.message : String(error), + ); + } // Fallback to memory backend if Redis is not available (e.g., in tests) defaultHandler = createCacheHandler({ backend: new MemoryCacheBackend(),