This document explains the fixes applied to resolve console errors in Next.js 15.5.5 + React 19.
Status: ✅ Fixed
What it was: Development-mode warning from React 19's Strict Mode and hot module reloading aborting fetch requests.
Solution:
- Console warnings automatically suppressed in development mode
- Query client configured to not retry on abort errors
- Utility functions provided for custom fetch handling
2. "Blocked aria-hidden on element" (Next.js Dev Overlay)
Status: ✅ Fixed
What it was: Next.js dev overlay accessibility warning (cosmetic, dev-only).
Solution:
- Warning suppressed in development mode
- No impact on production or your application code
-
lib/utils/suppressDevWarnings.ts- Automatically filters known dev-mode warnings
- Only active in development (
NODE_ENV === 'development') - Imported in
app/providers.tsx
-
lib/utils/errorHandler.ts- Utilities for handling abort errors gracefully
- Functions:
isAbortError(),fetchWithAbortHandler(),createAbortControllerWithTimeout() - Ready to use in custom API calls
-
lib/utils/fetchExample.ts- Example implementations showing best practices
- Includes React hooks and retry logic
- Reference for handling async operations
-
lib/utils/DEV_ERROR_HANDLING.md- Comprehensive documentation
- Explains why errors occur and how they're handled
-
app/providers.tsx- Added import:
import "@/lib/utils/suppressDevWarnings" - Activates console filtering in development
- Added import:
-
config.ts- Updated React Query client with intelligent retry logic
- Prevents retrying aborted requests
- Applies to both queries and mutations
// In suppressDevWarnings.ts
console.error = (...args) => {
const message = args.join(' ');
if (shouldSuppress(message)) return; // Skip known warnings
originalError.apply(console, args);
};// In config.ts
retry: (failureCount, error) => {
if (error instanceof Error && error.name === 'AbortError') {
return false; // Don't retry abort errors
}
return failureCount < 1;
}-
Start the dev server:
npm run dev
-
Check the console:
- You should see:
[Dev Mode] Warning suppression active - Abort signal warnings should be gone
- Aria-hidden warnings should be gone
- You should see:
-
Verify functionality:
- App should work normally
- Authentication flows should be unaffected
- Video loading should work as expected
If you need to see the suppressed warnings:
Option 1: Temporarily disable suppression
// In app/providers.tsx, comment out:
// import "@/lib/utils/suppressDevWarnings";Option 2: Enable debug logging
// In suppressDevWarnings.ts, uncomment:
console.debug('[Suppressed Error]:', ...args);- ✅ All suppressions only run in development mode
- ✅ Production builds are unaffected
- ✅ All errors will log normally in production
- ✅ Retry logic still handles abort errors intelligently
When making custom API calls:
import { fetchWithAbortHandler } from '@/lib/utils/errorHandler';
// With timeout
const controller = createAbortControllerWithTimeout(5000);
const data = await fetchWithAbortHandler('/api/endpoint', {
signal: controller.signal,
onAbort: () => console.log('Request cancelled')
});
// In React hooks
useEffect(() => {
const controller = new AbortController();
fetch('/api/data', { signal: controller.signal })
.then(handleSuccess)
.catch(error => {
if (!isAbortError(error)) {
// Only handle non-abort errors
handleError(error);
}
});
return () => controller.abort(); // Cleanup
}, []);- Development Only: Suppressions only run in dev mode
- Non-Invasive: Doesn't change app logic, just filters console output
- Reversible: Easy to disable if needed
- Best Practices: Query client improvements follow React Query recommendations
- Type-Safe: All TypeScript types are properly defined
-
The errors were coming from:
- React 19's new Strict Mode behavior
- Account Kit's background queries
- Livepeer SDK requests during HMR
- Next.js dev overlay implementation
-
None of these affected functionality, just created console noise
-
In production, these warnings don't occur naturally because:
- No HMR (Hot Module Reloading)
- No React Strict Mode double-mounting
- No dev overlay
See the detailed documentation in:
lib/utils/DEV_ERROR_HANDLING.md- Comprehensive guidelib/utils/fetchExample.ts- Code examples
🎉 Your console should now be clean in development mode!
The errors were cosmetic development-mode warnings that didn't affect functionality. The fixes:
- Suppress known dev warnings
- Handle abort errors intelligently
- Provide utilities for custom code
- Don't affect production at all