gebeya-dala-error-fixer
Version:
Automatic runtime error detection and fix suggestions for Next.js applications with config-based setup
67 lines (54 loc) • 1.77 kB
JavaScript
// error-detector.config.js
// Configuration file for gebeya-dala-error-fixer
module.exports = {
// Enable/disable error detection
enabled: true,
// Automatically show error modal when errors occur
autoShow: true,
// Position of the floating error button
position: 'top-right', // 'top-right', 'top-left', 'bottom-right', 'bottom-left'
// Environment where error detection should be active
environment: 'development', // 'development', 'production', 'all'
// UI theme
theme: 'dark', // 'dark', 'light'
// Custom error patterns (optional)
customPatterns: [
{
pattern: 'Custom error pattern',
title: 'Custom Error',
description: 'Description of the custom error',
code: '// Example fix code',
actions: [
'First action to fix',
'Second action to fix'
]
}
],
// Patterns to exclude from error detection
excludePatterns: [
'Warning: ReactDOM.render is no longer supported',
'console.warn'
],
// Show stack traces in error details
showStackTrace: true,
// Enable console error override (recommended)
enableConsoleOverride: true,
// Enable unhandled promise rejection detection
enableUnhandledRejection: true,
// Enable React error boundary
enableErrorBoundary: true,
// Fix It button configuration
fixItButton: {
enabled: true,
// Optional custom action function
customAction: (error, suggestion) => {
// Custom logic when "Fix It" is clicked
console.log('Custom fix action:', error, suggestion);
// Example: Copy code to clipboard
if (suggestion.code) {
navigator.clipboard.writeText(suggestion.code);
alert('Code copied to clipboard!');
}
}
}
};