fix: resolve Bayer MGA provider bundling issues

- Fix TypeScript compilation errors in debug API route that were causing JavaScript bundling failures
- Add proper type definitions for API responses and test results
- Fix type conversions and parameter typing throughout debug route
- Update auth controls with proper error state typing
- Resolve 'Cannot access xs before initialization' runtime error in production

This fixes the EKS deployment crash by eliminating TypeScript compilation issues that were causing JavaScript module loading problems.
This commit is contained in:
Nirmal Arya
2025-05-31 15:59:21 -04:00
parent 6a357e91a6
commit b983302406
3 changed files with 77 additions and 19 deletions

View File

@@ -8,7 +8,7 @@ import { useState, useEffect } from 'react';
*/
export default function HeaderAuthControls() {
// Error state for component-level error handling
const [renderError, setRenderError] = useState(null);
const [renderError, setRenderError] = useState<Error | null>(null);
// Call useAuth at the top level of the component as required by React hooks rules
let authState;
@@ -159,7 +159,7 @@ export default function HeaderAuthControls() {
} catch (error) {
// Catch any rendering errors
console.error('Error rendering auth controls:', error);
setRenderError(error);
setRenderError(error instanceof Error ? error : new Error(String(error)));
// Return fallback UI
return (