Skip to content

Commit 88aa9f9

Browse files
committed
fix: handle not existing routes
1 parent 7d365e3 commit 88aa9f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

svelte.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import adapter from '@sveltejs/adapter-static';
22
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33

4+
/** @type {import('@sveltejs/kit').Config} */
45
const config = {
56
preprocess: vitePreprocess(),
67
kit: {
@@ -11,6 +12,12 @@ const config = {
1112
},
1213
env: {
1314
publicPrefix: 'RV'
15+
},
16+
prerender: {
17+
handleHttpError: ({ status, message }) => {
18+
if (status === 404) return;
19+
throw new Error(message);
20+
}
1421
}
1522
}
1623
};

0 commit comments

Comments
 (0)