My files structure is this:
/routes├── [slug]│├──+page.svelte├── portfolio/[slug]│├──+error.svelte│└──+page.svelte├──+error.svelte├──+layout.server.js├──+layout.svelte├──+page.svelte└──+server.js
In layout.server.js
I check URLs to send the correct data (not sure it's the right way but so far so good):
// +layout.server.jsimport { error } from '@sveltejs/kit';export async function load({ url }) { //...run some code if(urlNotfound) { throw error(404, 'Not found here'); } return { correctData };}
I want the correct (or at least any) +error.svelte
page to display but none of them is shown. I keep having the native error page. Why?