From a58b207957187dd150efb7b6b9844f242a21f7d7 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Sat, 28 Mar 2026 10:49:57 +0100 Subject: [PATCH] Update Vite configuration and enhance error handling in Svelte components - Added 'tldts' and 'tldts-core' to the Vite SSR noExternal configuration. - Refactored error handling in +error.svelte and auth-failed/+page.svelte to use a goHome function for navigation instead of href attributes. --- apps/dashboard/src/routes/(auth)/auth-failed/+page.svelte | 6 +++++- apps/dashboard/src/routes/+error.svelte | 8 ++++++-- apps/dashboard/vite.config.ts | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/dashboard/src/routes/(auth)/auth-failed/+page.svelte b/apps/dashboard/src/routes/(auth)/auth-failed/+page.svelte index 47f1f79f..3dc6d548 100644 --- a/apps/dashboard/src/routes/(auth)/auth-failed/+page.svelte +++ b/apps/dashboard/src/routes/(auth)/auth-failed/+page.svelte @@ -7,6 +7,10 @@ import * as Avatar from '@cio/ui/base/avatar'; const errorCode = $derived(new URLSearchParams(page.url.search).get('error')); + + function goHome() { + window.location.href = '/'; + } @@ -36,6 +40,6 @@ find more information about the error here. - + diff --git a/apps/dashboard/src/routes/+error.svelte b/apps/dashboard/src/routes/+error.svelte index 0310c7ad..05d51b44 100644 --- a/apps/dashboard/src/routes/+error.svelte +++ b/apps/dashboard/src/routes/+error.svelte @@ -7,6 +7,10 @@ const isNotFound = $derived(page.status === 404); console.error('error message', page.error?.message); + + function goHome() { + window.location.href = '/'; + } @@ -23,7 +27,7 @@ showLogo={true} >
- +
{:else} @@ -37,7 +41,7 @@ >
- +
{/if} diff --git a/apps/dashboard/vite.config.ts b/apps/dashboard/vite.config.ts index 8c546d43..82d58a8b 100644 --- a/apps/dashboard/vite.config.ts +++ b/apps/dashboard/vite.config.ts @@ -20,7 +20,7 @@ export default ({ mode }) => { sourcemap: false }, ssr: { - noExternal: ['svelte-sonner', 'layerchart', 'svelte-toolbelt'] + noExternal: ['svelte-sonner', 'layerchart', 'svelte-toolbelt', 'tldts', 'tldts-core'] }, optimizeDeps: { entries: ['src/routes/**/+*.{js,ts,svelte}'],