@lobehub/chat 1.51.5 → 1.51.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.51.6](https://github.com/lobehub/lobe-chat/compare/v1.51.5...v1.51.6)
6
+
7
+ <sup>Released on **2025-02-06**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Try to fix discover error.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Try to fix discover error, closes [#5794](https://github.com/lobehub/lobe-chat/issues/5794) ([9b7bd99](https://github.com/lobehub/lobe-chat/commit/9b7bd99))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.51.5](https://github.com/lobehub/lobe-chat/compare/v1.51.4...v1.51.5)
6
31
 
7
32
  <sup>Released on **2025-02-06**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Try to fix discover error."
6
+ ]
7
+ },
8
+ "date": "2025-02-06",
9
+ "version": "1.51.6"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/next.config.ts CHANGED
@@ -176,11 +176,6 @@ const nextConfig: NextConfig = {
176
176
  permanent: false,
177
177
  source: '/repos',
178
178
  },
179
- {
180
- destination: '/files',
181
- permanent: false,
182
- source: '/repos',
183
- },
184
179
  ],
185
180
  // when external packages in dev mode with turbopack, this config will lead to bundle error
186
181
  serverExternalPackages: isProd ? ['@electric-sql/pglite'] : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.51.5",
3
+ "version": "1.51.6",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -9,6 +9,7 @@ import { DiscoverService } from '@/server/services/discover';
9
9
  import { translation } from '@/server/translation';
10
10
  import { DiscoverProviderItem } from '@/types/discover';
11
11
  import { PageProps } from '@/types/next';
12
+ import { parsePageLocale } from '@/utils/locale';
12
13
  import { RouteVariants } from '@/utils/server/routeVariants';
13
14
 
14
15
  import DetailLayout from '../../features/DetailLayout';
@@ -26,9 +27,10 @@ export const generateMetadata = async (props: Props) => {
26
27
 
27
28
  const { slugs } = params;
28
29
  const identifier = decodeURIComponent(slugs.join('/'));
29
- const { t, locale } = await translation('metadata', searchParams?.hl);
30
+ const { t } = await translation('metadata', searchParams?.hl);
30
31
  const { t: td } = await translation('models', searchParams?.hl);
31
32
 
33
+ const locale = await parsePageLocale(props);
32
34
  const discoverService = new DiscoverService();
33
35
  const data = await discoverService.getModelById(locale, identifier);
34
36
  if (!data) return;
@@ -70,9 +72,11 @@ const Page = async (props: Props) => {
70
72
  const { slugs } = params;
71
73
 
72
74
  const identifier = decodeURIComponent(slugs.join('/'));
73
- const { t, locale } = await translation('metadata', searchParams?.hl);
75
+ const { t } = await translation('metadata', searchParams?.hl);
74
76
  const { t: td } = await translation('models', searchParams?.hl);
77
+
75
78
  const mobile = await RouteVariants.getIsMobile(props);
79
+ const locale = await parsePageLocale(props);
76
80
 
77
81
  const discoverService = new DiscoverService();
78
82
  const data = await discoverService.getModelById(locale, identifier);
@@ -7,6 +7,7 @@ import { metadataModule } from '@/server/metadata';
7
7
  import { DiscoverService } from '@/server/services/discover';
8
8
  import { translation } from '@/server/translation';
9
9
  import { DiscoverPageProps } from '@/types/discover';
10
+ import { parsePageLocale } from '@/utils/locale';
10
11
  import { RouteVariants } from '@/utils/server/routeVariants';
11
12
 
12
13
  import List from '../features/List';
@@ -15,7 +16,8 @@ export const generateMetadata = async (props: DiscoverPageProps) => {
15
16
  const params = await props.params;
16
17
  const searchParams = await props.searchParams;
17
18
 
18
- const { t, locale } = await translation('metadata', searchParams?.hl);
19
+ const { t } = await translation('metadata', searchParams?.hl);
20
+ const locale = await parsePageLocale(props);
19
21
 
20
22
  const discoverService = new DiscoverService();
21
23
  const list = await discoverService.getProviderList(locale);
@@ -34,8 +36,9 @@ const Page = async (props: DiscoverPageProps) => {
34
36
  const params = await props.params;
35
37
  const searchParams = await props.searchParams;
36
38
 
37
- const { t, locale } = await translation('metadata', searchParams?.hl);
39
+ const { t } = await translation('metadata', searchParams?.hl);
38
40
  const mobile = await RouteVariants.getIsMobile(props);
41
+ const locale = await parsePageLocale(props);
39
42
 
40
43
  const discoverService = new DiscoverService();
41
44
  const list = await discoverService.getProviderList(locale);
@@ -62,10 +65,8 @@ const Page = async (props: DiscoverPageProps) => {
62
65
 
63
66
  export const generateStaticParams = async () => {
64
67
  const discoverService = new DiscoverService();
65
- const cates = await discoverService.getProviderList(DEFAULT_LANG);
66
- return cates.map((cate) => ({
67
- slug: cate.identifier,
68
- }));
68
+ const categories = await discoverService.getProviderList(DEFAULT_LANG);
69
+ return categories.map((cate) => ({ slug: cate.identifier }));
69
70
  };
70
71
 
71
72
  Page.DisplayName = 'DiscoverModelsCategory';
@@ -8,6 +8,7 @@ import { memo, useEffect, useState } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import urlJoin from 'url-join';
10
10
 
11
+ import { withSuspense } from '@/components/withSuspense';
11
12
  import { useQueryRoute } from '@/hooks/useQueryRoute';
12
13
  import { DiscoverTab } from '@/types/discover';
13
14
 
@@ -79,4 +80,4 @@ const StoreSearchBar = memo<StoreSearchBarProps>(({ mobile, onBlur, onFocus, ...
79
80
  );
80
81
  });
81
82
 
82
- export default StoreSearchBar;
83
+ export default withSuspense(StoreSearchBar);
@@ -10,5 +10,3 @@ const MainLayout = ServerLayout<PropsWithChildren>({ Desktop, Mobile });
10
10
  MainLayout.displayName = 'DiscoverStoreLayout';
11
11
 
12
12
  export default MainLayout;
13
-
14
- export const dynamic = 'force-static';
@@ -71,3 +71,5 @@ const Page = async (props: Props) => {
71
71
  Page.DisplayName = 'DiscoverSearch';
72
72
 
73
73
  export default Page;
74
+
75
+ export const dynamic = 'force-static';