Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Update dependency react-error-boundary to v6 (#4924)

renovate[bot]3010bd992b44
diff --git a/web/components/chat/ChatContainer/ChatContainer.tsx b/web/components/chat/ChatContainer/ChatContainer.tsx
index 05ab70efde..19b12af17a 100644
--- a/web/components/chat/ChatContainer/ChatContainer.tsx
+++ b/web/components/chat/ChatContainer/ChatContainer.tsx
@@ -1,6 +1,6 @@
import { Virtuoso } from 'react-virtuoso';
import { useState, useMemo, useRef, CSSProperties, FC, useEffect } from 'react';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { Interweave } from 'interweave';
import {
ConnectedClientInfoEvent,
@@ -359,7 +359,7 @@ export const ChatContainer: FC<ChatContainerProps> = ({
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="ChatContainer"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx b/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx
index 3bcc83cbcc..14f2d0be10 100644
--- a/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx
+++ b/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx
@@ -3,7 +3,7 @@ import { FC, useEffect, useState } from 'react';
import { format } from 'date-fns';
import { ColumnsType } from 'antd/lib/table';
import dynamic from 'next/dynamic';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import ChatModeration from '../../../services/moderation-service';
import styles from './ChatModerationDetailsModal.module.scss';
import { formatUAstring } from '../../../utils/format';
@@ -155,7 +155,7 @@ export const ChatModerationDetailsModal: FC<ChatModerationDetailsModalProps> = (
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="ChatModerationDetailsModal"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/common/UserDropdown/UserDropdown.tsx b/web/components/common/UserDropdown/UserDropdown.tsx
index 20afc8a76b..e75f0c21fe 100644
--- a/web/components/common/UserDropdown/UserDropdown.tsx
+++ b/web/components/common/UserDropdown/UserDropdown.tsx
@@ -5,7 +5,7 @@ import { useRecoilState, useRecoilValue } from 'recoil';
import { FC, useEffect, useState } from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import dynamic from 'next/dynamic';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import {
ChatState,
chatStateAtom,
@@ -204,7 +204,7 @@ export const UserDropdown: FC<UserDropdownProps> = ({
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="UserDropdown"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/modals/AuthModal/AuthModal.tsx b/web/components/modals/AuthModal/AuthModal.tsx
index bd3a90fffd..1df225c168 100644
--- a/web/components/modals/AuthModal/AuthModal.tsx
+++ b/web/components/modals/AuthModal/AuthModal.tsx
@@ -1,7 +1,7 @@
import { Modal, Tabs } from 'antd';
import { useRecoilValue } from 'recoil';
import { FC } from 'react';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { IndieAuthModal } from '../IndieAuthModal/IndieAuthModal';
import { FediAuthModal } from '../FediAuthModal/FediAuthModal';
import { getPendingFediverseAuth } from '../../../utils/fediverseAuthSession';
@@ -90,7 +90,7 @@ export const AuthModal: FC<AuthModalProps> = ({ open, handleClose, forceTabs })
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="AuthModal"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx
index 1081a46443..701b744dac 100644
--- a/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx
+++ b/web/components/modals/BrowserNotifyModal/BrowserNotifyModal.tsx
@@ -2,7 +2,7 @@ import { Row, Spin, Typography, Button, Alert, Modal } from 'antd';
import React, { FC, useState } from 'react';
import { PlusSquareOutlined, UploadOutlined } from '@ant-design/icons';
import { useRecoilValue } from 'recoil';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { useTranslation } from 'next-export-i18n';
import { accessTokenAtom, clientConfigStateAtom } from '../../stores/ClientConfigStore';
import {
@@ -270,7 +270,7 @@ const NotifyModalContent = () => {
fallbackRender={({ error: e, resetErrorBoundary }) => (
<ComponentError
componentName="BrowserNotifyModal"
- message={e.message}
+ message={getErrorMessage(e)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/modals/ChatModal/ChatModal.tsx b/web/components/modals/ChatModal/ChatModal.tsx
index e75ace8644..8dd92bd5ae 100644
--- a/web/components/modals/ChatModal/ChatModal.tsx
+++ b/web/components/modals/ChatModal/ChatModal.tsx
@@ -1,6 +1,6 @@
import { Modal } from 'antd';
import { FC } from 'react';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import styles from './ChatModal.module.scss';
@@ -41,7 +41,7 @@ export const ChatModal: FC<ChatModalProps> = ({
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="ChatModal"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/ui/Content/DesktopContent.tsx b/web/components/ui/Content/DesktopContent.tsx
index 0b2d665075..94bcdc96b8 100644
--- a/web/components/ui/Content/DesktopContent.tsx
+++ b/web/components/ui/Content/DesktopContent.tsx
@@ -1,7 +1,7 @@
import React, { ComponentType, FC } from 'react';
import dynamic from 'next/dynamic';
import { TabsProps } from 'antd';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { SocialLink } from '../../../interfaces/social-link.model';
import { PluginTab } from '../../../interfaces/client-config.model';
import styles from './Content.module.scss';
@@ -111,7 +111,7 @@ export const DesktopContent: FC<DesktopContentProps> = ({
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="DesktopContent"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/ui/Modal/Modal.tsx b/web/components/ui/Modal/Modal.tsx
index ec13e12ad2..d78831d3b2 100644
--- a/web/components/ui/Modal/Modal.tsx
+++ b/web/components/ui/Modal/Modal.tsx
@@ -1,6 +1,6 @@
import { Spin, Modal as AntModal } from 'antd';
import React, { FC, ReactNode, useState } from 'react';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { ComponentError } from '../ComponentError/ComponentError';
import styles from './Modal.module.scss';
@@ -84,7 +84,7 @@ export const Modal: FC<ModalProps> = ({
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="Modal"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/ui/SocialLinks/SocialLinks.tsx b/web/components/ui/SocialLinks/SocialLinks.tsx
index 82d7f6fb06..113af0883f 100644
--- a/web/components/ui/SocialLinks/SocialLinks.tsx
+++ b/web/components/ui/SocialLinks/SocialLinks.tsx
@@ -1,6 +1,6 @@
import Image from 'next/image';
import { FC } from 'react';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { SocialLink } from '../../../interfaces/social-link.model';
import { ComponentError } from '../ComponentError/ComponentError';
import styles from './SocialLinks.module.scss';
@@ -20,7 +20,7 @@ export const SocialLinks: FC<SocialLinksProps> = ({ links }) => {
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="SocialLinks"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx b/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx
index 6b2099fbac..7a573a0915 100644
--- a/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx
+++ b/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx
@@ -1,6 +1,6 @@
import { FC, useEffect, useState } from 'react';
import { Pagination, Spin } from 'antd';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { Follower } from '../../../../interfaces/follower';
import { SingleFollower } from '../SingleFollower/SingleFollower';
import styles from './FollowerCollection.module.scss';
@@ -72,7 +72,7 @@ export const FollowerCollection: FC<FollowerCollectionProps> = ({ name, onFollow
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="FollowerCollection"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/components/video/OwncastPlayer/OwncastPlayer.tsx b/web/components/video/OwncastPlayer/OwncastPlayer.tsx
index db6c3e0a55..e929e498a8 100644
--- a/web/components/video/OwncastPlayer/OwncastPlayer.tsx
+++ b/web/components/video/OwncastPlayer/OwncastPlayer.tsx
@@ -4,7 +4,7 @@ import { useRecoilState, useRecoilValue } from 'recoil';
import { useHotkeys } from 'react-hotkeys-hook';
import { useTranslation } from 'next-export-i18n';
import classNames from 'classnames';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { VideoJS } from '../VideoJS/VideoJS';
import ViewerPing from '../viewer-ping';
import { VideoPoster } from '../VideoPoster/VideoPoster';
@@ -376,7 +376,7 @@ export const OwncastPlayer: FC<OwncastPlayerProps> = ({
fallbackRender={({ error, resetErrorBoundary }) => (
<ComponentError
componentName="OwncastPlayer"
- message={error.message}
+ message={getErrorMessage(error)}
retryFunction={resetErrorBoundary}
/>
)}
diff --git a/web/package-lock.json b/web/package-lock.json
index 6e79f23a8c..4bb9a151d1 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -46,7 +46,7 @@
"react": "18.3.1",
"react-chartjs-2": "^5.2.0",
"react-dom": "18.3.1",
- "react-error-boundary": "^5.0.0",
+ "react-error-boundary": "^6.0.0",
"react-hotkeys-hook": "5.3.3",
"react-linkify": "1.0.0-alpha",
"react-markdown": "10.1.0",
@@ -28677,15 +28677,12 @@
}
},
"node_modules/react-error-boundary": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-5.0.0.tgz",
- "integrity": "sha512-tnjAxG+IkpLephNcePNA7v6F/QpWLH8He65+DmedchDwg162JZqx4NmbXj0mlAYVVEd81OW7aFhmbsScYfiAFQ==",
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-6.1.2.tgz",
+ "integrity": "sha512-3DpCr5HVdZ0caUjYE/kIHBEJN0mNP3ZCgf16c48uJ5TbWjorKVp+YG8W3XqlJ7vJAVNw6wNIImyPXmFydwmyng==",
"license": "MIT",
- "dependencies": {
- "@babel/runtime": "^7.12.5"
- },
"peerDependencies": {
- "react": ">=16.13.1"
+ "react": "^18.0.0 || ^19.0.0"
}
},
"node_modules/react-hotkeys-hook": {
diff --git a/web/package.json b/web/package.json
index 28d774fbe4..a673de4237 100644
--- a/web/package.json
+++ b/web/package.json
@@ -65,7 +65,7 @@
"react": "18.3.1",
"react-chartjs-2": "^5.2.0",
"react-dom": "18.3.1",
- "react-error-boundary": "^5.0.0",
+ "react-error-boundary": "^6.0.0",
"react-hotkeys-hook": "5.3.3",
"react-linkify": "1.0.0-alpha",
"react-markdown": "10.1.0",
diff --git a/web/pages/embed/chat/readonly/index.tsx b/web/pages/embed/chat/readonly/index.tsx
index 6bd6727721..de1e993450 100644
--- a/web/pages/embed/chat/readonly/index.tsx
+++ b/web/pages/embed/chat/readonly/index.tsx
@@ -1,7 +1,7 @@
import { useRecoilValue } from 'recoil';
import Head from 'next/head';
import { useTranslation } from 'next-export-i18n';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { ChatMessage } from '../../../../interfaces/chat-message.model';
import { ChatContainer } from '../../../../components/chat/ChatContainer/ChatContainer';
import {
@@ -35,7 +35,7 @@ export default function ReadOnlyChatEmbed() {
<ErrorBoundary
// eslint-disable-next-line react/no-unstable-nested-components
fallbackRender={({ error }) => (
- <ComponentError componentName="ReadOnlyChatEmbed" message={error.message} />
+ <ComponentError componentName="ReadOnlyChatEmbed" message={getErrorMessage(error)} />
)}
>
<ClientConfigStore />
diff --git a/web/pages/embed/chat/readwrite/index.tsx b/web/pages/embed/chat/readwrite/index.tsx
index 965e0f9e5f..8104a6d909 100644
--- a/web/pages/embed/chat/readwrite/index.tsx
+++ b/web/pages/embed/chat/readwrite/index.tsx
@@ -3,7 +3,7 @@ import { useRecoilValue } from 'recoil';
import { useEffect } from 'react';
import Head from 'next/head';
import { useTranslation } from 'next-export-i18n';
-import { ErrorBoundary } from 'react-error-boundary';
+import { ErrorBoundary, getErrorMessage } from 'react-error-boundary';
import { ChatMessage } from '../../../../interfaces/chat-message.model';
import { ChatContainer } from '../../../../components/chat/ChatContainer/ChatContainer';
import {
@@ -95,7 +95,7 @@ export default function ReadWriteChatEmbed() {
<ErrorBoundary
// eslint-disable-next-line react/no-unstable-nested-components
fallbackRender={({ error }) => (
- <ComponentError componentName="ReadWriteChatEmbed" message={error.message} />
+ <ComponentError componentName="ReadWriteChatEmbed" message={getErrorMessage(error)} />
)}
>
<div className="embed-container">