fix(error tracking): streamline Rybbit integration by removing unnecessary type assertions

- Updated ErrorBoundary and ErrorTracking components to directly access the Rybbit object without type assertions.
- Enhanced error tracking by ensuring stack traces and component stacks are only included if available.
- Improved the HeroSection component by replacing the standard img tag with Next.js Image component for better performance and optimization.
This commit is contained in:
Evandro Fonseca Junior committed 2026-01-20 21:36:20 -03:00
1 parent 4e14cc79ff
commit 50ffed4fee
4 files changed
+43 -10

No files matched your search

+4 -4
View File
@@ -27,12 +27,12 @@ export class ErrorBoundary extends Component<Props, State> {
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
// Enviar erro ao Rybbit se disponível
if (typeof window !== "undefined" && (window as any).rybbit) {
if (typeof window !== "undefined" && window.rybbit) {
try {
(window as any).rybbit.track("error", {
window.rybbit.track("error", {
message: error.message,
stack: error.stack,
componentStack: errorInfo.componentStack,
stack: error.stack || undefined,
componentStack: errorInfo.componentStack || undefined,
errorName: error.name,
timestamp: new Date().toISOString(),
});