Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: add skill crash (#13011)

Rdmclin2d9388f2c318f
diff --git a/src/components/Error/index.tsx b/src/components/Error/index.tsx
index 24d8baabc51..59acd1dd20a 100644
--- a/src/components/Error/index.tsx
+++ b/src/components/Error/index.tsx
@@ -18,7 +18,7 @@ const ErrorCapture = ({ error, reset }: ErrorCaptureProps) => {
const defaultStackKeys = typeof __CI__ !== 'undefined' && __CI__ ? ['stack'] : [];
return (
- <Flexbox align={'center'} justify={'center'} style={{ minHeight: '100%', width: '100%' }}>
+ <Flexbox align={'center'} justify={'center'} style={{ minHeight: '100dvh', width: '100%' }}>
<h1
style={{
filter: 'blur(8px)',
diff --git a/src/features/SkillStore/index.tsx b/src/features/SkillStore/index.tsx
index 8e3f15dc4d8..1c60563ac54 100644
--- a/src/features/SkillStore/index.tsx
+++ b/src/features/SkillStore/index.tsx
@@ -2,7 +2,6 @@
import { createModal, LOBE_THEME_APP_ID } from '@lobehub/ui';
import { t } from 'i18next';
-import { MemoryRouter } from 'react-router-dom';
import { isDesktop } from '@/const/version';
import { MarketAuthProvider } from '@/layout/AuthProvider/MarketAuth';
@@ -13,11 +12,9 @@ export const createSkillStoreModal = () =>
createModal({
allowFullscreen: true,
children: (
- <MemoryRouter>
- <MarketAuthProvider isDesktop={isDesktop}>
- <SkillStoreContent />
- </MarketAuthProvider>
- </MemoryRouter>
+ <MarketAuthProvider isDesktop={isDesktop}>
+ <SkillStoreContent />
+ </MarketAuthProvider>
),
destroyOnHidden: false,
footer: null,
diff --git a/src/routes/(main)/home/features/InputArea/SkillInstallBanner.tsx b/src/routes/(main)/home/features/InputArea/SkillInstallBanner.tsx
index 24440a03e7d..12e89dd5cbd 100644
--- a/src/routes/(main)/home/features/InputArea/SkillInstallBanner.tsx
+++ b/src/routes/(main)/home/features/InputArea/SkillInstallBanner.tsx
@@ -113,7 +113,7 @@ const SkillInstallBanner = memo(() => {
}, []);
return (
- <div className={styles.banner} onClick={handleOpenStore}>
+ <div className={styles.banner} data-testid="skill-install-banner" onClick={handleOpenStore}>
<Flexbox horizontal align="center" gap={4}>
<Icon className={styles.icon} icon={Blocks} size={18} />
<span className={styles.text}>{t('skillInstallBanner.title')}</span>
diff --git a/src/utils/router.tsx b/src/utils/router.tsx
index 9b3ea8e60cd..b3e8b506f45 100644
--- a/src/utils/router.tsx
+++ b/src/utils/router.tsx
@@ -1,7 +1,8 @@
'use client';
+import { ThemeProvider } from '@lobehub/ui';
import { type ComponentType, type ReactElement } from 'react';
-import { createElement, lazy, memo, Suspense, useCallback, useEffect } from 'react';
+import { lazy, memo, Suspense, useCallback, useEffect } from 'react';
import type { RouteObject } from 'react-router-dom';
import {
createBrowserRouter,
@@ -112,7 +113,11 @@ export const ErrorBoundary = ({ resetPath }: ErrorBoundaryProps) => {
notifyChunkError();
}
- return createElement(ErrorCapture, { error, reset });
+ return (
+ <ThemeProvider theme={{ cssVar: { key: 'lobe-vars' } }}>
+ <ErrorCapture error={error} reset={reset} />
+ </ThemeProvider>
+ );
};
/**