Fix $state runtime error: rename rune stores to .svelte.ts
$state runes only work in .svelte and .svelte.ts files. The toasts and theme stores used $state in plain .ts files, which compiled in dev but crashed in production SSR. Renamed and updated all imports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { fly } from 'svelte/transition';
|
||||
import { getToasts, removeToast, type ToastType } from '$lib/stores/toasts.js';
|
||||
import { getToasts, removeToast, type ToastType } from '$lib/stores/toasts.svelte.js';
|
||||
|
||||
const toasts = $derived(getToasts());
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { toast } from '$lib/stores/toasts.js';
|
||||
import { toast } from '$lib/stores/toasts.svelte.js';
|
||||
import { getSocketId } from '$lib/stores/socket.js';
|
||||
|
||||
export type ApiResult<T = any> = {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import type { Snippet } from 'svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { connectSocket, disconnectSocket } from '$lib/stores/socket.js';
|
||||
import { initTheme, toggleTheme, getTheme } from '$lib/stores/theme.js';
|
||||
import { initTheme, toggleTheme, getTheme } from '$lib/stores/theme.svelte.js';
|
||||
import NotificationBell from '$lib/components/NotificationBell.svelte';
|
||||
import SearchBar from '$lib/components/SearchBar.svelte';
|
||||
import Toast from '$lib/components/Toast.svelte';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { api } from '$lib/utils/api.js';
|
||||
import { toast } from '$lib/stores/toasts.js';
|
||||
import { toast } from '$lib/stores/toasts.svelte.js';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { api } from '$lib/utils/api.js';
|
||||
import { toast } from '$lib/stores/toasts.js';
|
||||
import { toast } from '$lib/stores/toasts.svelte.js';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import { replaceState } from '$app/navigation';
|
||||
import { api } from '$lib/utils/api.js';
|
||||
import { toast } from '$lib/stores/toasts.js';
|
||||
import { toast } from '$lib/stores/toasts.svelte.js';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { getDueUrgency, getUrgencyClasses, formatDueDate } from '$lib/utils/due-date.js';
|
||||
import { joinBoard, leaveBoard, onBoardEvent, offBoardEvent, getSocketId } from '$lib/stores/socket.js';
|
||||
import { api } from '$lib/utils/api.js';
|
||||
import { toast } from '$lib/stores/toasts.js';
|
||||
import { toast } from '$lib/stores/toasts.svelte.js';
|
||||
import CardModal from '$lib/components/CardModal.svelte';
|
||||
import ActivityFeed from '$lib/components/ActivityFeed.svelte';
|
||||
import BoardFilters from '$lib/components/BoardFilters.svelte';
|
||||
|
||||
Reference in New Issue
Block a user