mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 05:13:38 +02:00
fix(contacts): resolve Svelte 5 hydration error
- Move type exports from .svelte files to separate .types.ts files (FilterDropdown, CommandBar) to prevent SSR hydration issues - Replace direct NetworkGraph component import in network store with TypeScript interface to avoid SSR component instantiation - Add missing shared packages to vite.config.ts ssr.noExternal and optimizeDeps.exclude (splitscreen, i18n, profile-ui, etc.) The hydration error "Cannot read properties of undefined (reading 'call')" was caused by Svelte 5's stricter handling of component imports in .svelte.ts files and type exports from .svelte files during SSR. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c4fe9ea192
commit
026c1654e3
8 changed files with 774 additions and 27 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import type { CommandBarItem, QuickAction, CreatePreview } from './CommandBar.types';
|
||||
|
||||
// Syntax highlighting patterns for command keywords
|
||||
interface HighlightPattern {
|
||||
|
|
@ -42,29 +43,6 @@
|
|||
return result;
|
||||
}
|
||||
|
||||
export interface CommandBarItem {
|
||||
id: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
icon?: string;
|
||||
imageUrl?: string;
|
||||
isFavorite?: boolean;
|
||||
}
|
||||
|
||||
export interface QuickAction {
|
||||
id: string;
|
||||
label: string;
|
||||
href?: string;
|
||||
icon: string;
|
||||
shortcut?: string;
|
||||
onclick?: () => void;
|
||||
}
|
||||
|
||||
export interface CreatePreview {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
|
|
|
|||
22
packages/shared-ui/src/command-bar/CommandBar.types.ts
Normal file
22
packages/shared-ui/src/command-bar/CommandBar.types.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
export interface CommandBarItem {
|
||||
id: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
icon?: string;
|
||||
imageUrl?: string;
|
||||
isFavorite?: boolean;
|
||||
}
|
||||
|
||||
export interface QuickAction {
|
||||
id: string;
|
||||
label: string;
|
||||
href?: string;
|
||||
icon: string;
|
||||
shortcut?: string;
|
||||
onclick?: () => void;
|
||||
}
|
||||
|
||||
export interface CreatePreview {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
}
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
export { default as CommandBar } from './CommandBar.svelte';
|
||||
export type { CommandBarItem, QuickAction, CreatePreview } from './CommandBar.svelte';
|
||||
export type { CommandBarItem, QuickAction, CreatePreview } from './CommandBar.types';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue