Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/forty-news-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

[breaking] change sveltekit.message to sveltekit.error.message
2 changes: 1 addition & 1 deletion documentation/docs/01-project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The `src` directory contains the meat of your project.
- `%sveltekit.nonce%` — a [CSP](/docs/configuration#csp) nonce for manually included links and scripts, if used
- `error.html` (optional) is the page that is rendered when everything else fails. It can contain the following placeholders:
- `%sveltekit.status%` — the HTTP status
- `%sveltekit.message%` — the error message
- `%sveltekit.error.message%` — the error message
- `hooks.js` (optional) contains your application's [hooks](/docs/hooks)
- `service-worker.js` (optional) contains your [service worker](/docs/service-workers)

Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/core/config/default-error.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>%sveltekit.message%</title>
<title>%sveltekit.error.message%</title>

<style>
body {
Expand Down Expand Up @@ -49,7 +49,7 @@
<div class="error">
<span class="status">%sveltekit.status%</span>
<div class="message">
<h1>%sveltekit.message%</h1>
<h1>%sveltekit.error.message%</h1>
</div>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/exports/vite/build/build_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const app_template = ({ head, body, assets, nonce }) => ${s(template)

const error_template = ({ status, message }) => ${s(error_page)
.replace(/%sveltekit\.status%/g, '" + status + "')
.replace(/%sveltekit\.message%/g, '" + message + "')};
.replace(/%sveltekit\.error\.message%/g, '" + message + "')};

let read = null;

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/exports/vite/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export async function dev(vite, vite_config, svelte_config) {
error_template: ({ status, message }) => {
return error_page
.replace(/%sveltekit\.status%/g, String(status))
.replace(/%sveltekit\.message%/g, message);
.replace(/%sveltekit\.error\.message%/g, message);
},
trailing_slash: svelte_config.kit.trailingSlash
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/test/apps/basics/src/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</head>
<body>
<h1>Error - %sveltekit.status%</h1>
<p>This is the static error page with the following message: %sveltekit.message%</p>
<p>This is the static error page with the following message: %sveltekit.error.message%</p>
</body>
</html>