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:
Till-JS 2025-12-14 21:13:22 +01:00
parent c4fe9ea192
commit 026c1654e3
8 changed files with 774 additions and 27 deletions

View file

@ -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;

View 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;
}

View file

@ -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';