diff --git a/.changeset/pretty-planets-deliver.md b/.changeset/pretty-planets-deliver.md new file mode 100644 index 000000000000..6bcebc66c2a4 --- /dev/null +++ b/.changeset/pretty-planets-deliver.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: use `{@render ...}` tag when generating default fallback page for svelte 5 apps diff --git a/packages/kit/.prettierignore b/packages/kit/.prettierignore index b9b739abb5ca..db7d272040ac 100644 --- a/packages/kit/.prettierignore +++ b/packages/kit/.prettierignore @@ -1,2 +1,3 @@ test/build-errors/apps/syntax-error/src/routes/+page.svelte /types +src/runtime/components/svelte-5/layout.svelte \ No newline at end of file diff --git a/packages/kit/src/core/sync/create_manifest_data/index.js b/packages/kit/src/core/sync/create_manifest_data/index.js index ab807f9f2f50..acf6476b5a9c 100644 --- a/packages/kit/src/core/sync/create_manifest_data/index.js +++ b/packages/kit/src/core/sync/create_manifest_data/index.js @@ -6,6 +6,7 @@ import { list_files, runtime_directory } from '../../utils.js'; import { posixify, resolve_entry } from '../../../utils/filesystem.js'; import { parse_route_id } from '../../../utils/routing.js'; import { sort_routes } from './sort.js'; +import { isSvelte5Plus } from '../utils.js'; /** * Generates the manifest data used for the client-side manifest and types generation. @@ -18,7 +19,7 @@ import { sort_routes } from './sort.js'; */ export default function create_manifest_data({ config, - fallback = `${runtime_directory}/components`, + fallback = `${runtime_directory}/components/${isSvelte5Plus() ? 'svelte-5' : 'svelte-4'}`, cwd = process.cwd() }) { const assets = create_assets(config); diff --git a/packages/kit/src/runtime/components/error.svelte b/packages/kit/src/runtime/components/svelte-4/error.svelte similarity index 100% rename from packages/kit/src/runtime/components/error.svelte rename to packages/kit/src/runtime/components/svelte-4/error.svelte diff --git a/packages/kit/src/runtime/components/layout.svelte b/packages/kit/src/runtime/components/svelte-4/layout.svelte similarity index 100% rename from packages/kit/src/runtime/components/layout.svelte rename to packages/kit/src/runtime/components/svelte-4/layout.svelte diff --git a/packages/kit/src/runtime/components/svelte-5/error.svelte b/packages/kit/src/runtime/components/svelte-5/error.svelte new file mode 100644 index 000000000000..b82ddfaed4b4 --- /dev/null +++ b/packages/kit/src/runtime/components/svelte-5/error.svelte @@ -0,0 +1,6 @@ + + +

{$page.status}

+

{$page.error?.message}

diff --git a/packages/kit/src/runtime/components/svelte-5/layout.svelte b/packages/kit/src/runtime/components/svelte-5/layout.svelte new file mode 100644 index 000000000000..4b7cb066e5aa --- /dev/null +++ b/packages/kit/src/runtime/components/svelte-5/layout.svelte @@ -0,0 +1,5 @@ + + +{@render children()}