Fix jwt-token

This commit is contained in:
2025-09-23 10:23:07 +02:00
parent 1e1a1ad488
commit 1fe5981095
2 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import React from 'react';
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = { hasError: false, error: null, errorInfo: null };
}
static getDerivedStateFromError(error) {
return { hasError: true };
}
componentDidCatch(error, errorInfo) {
console.error('ERROR BOUNDARY CAUGHT:', error);
console.error('ERROR BOUNDARY STACK:', errorInfo);
// Check if this is the specific object rendering error
if (error.message && error.message.includes('Objects are not valid as a React child')) {
console.error('🚨 FOUND THE OBJECT RENDERING ERROR!');
console.error('Error message:', error.message);
console.error('Stack trace:', error.stack);
console.error('Component stack:', errorInfo.componentStack);
}
this.setState({
error: error,
errorInfo: errorInfo
});
}
render() {
if (this.state.hasError) {
return (
<div style={{ padding: '20px', border: '2px solid red', margin: '10px' }}>
<h2>Something went wrong.</h2>
<details style={{ whiteSpace: 'pre-wrap' }}>
{this.state.error && this.state.error.toString()}
<br />
{this.state.errorInfo.componentStack}
</details>
</div>
);
}
return this.props.children;
}
}
export default ErrorBoundary;