From 385bd49efb6890078dcdb523fdf5b621fe1c3e72 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Wed, 15 Mar 2023 22:52:14 +0100 Subject: [PATCH] fix: don't start debugger on 404s (#9424) --- .changeset/dull-bears-destroy.md | 5 +++++ packages/kit/src/runtime/client/client.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/dull-bears-destroy.md diff --git a/.changeset/dull-bears-destroy.md b/.changeset/dull-bears-destroy.md new file mode 100644 index 000000000000..c9c079fe640d --- /dev/null +++ b/.changeset/dull-bears-destroy.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: don't start debugger on 404s diff --git a/packages/kit/src/runtime/client/client.js b/packages/kit/src/runtime/client/client.js index c4c4a559f190..09cb02e14103 100644 --- a/packages/kit/src/runtime/client/client.js +++ b/packages/kit/src/runtime/client/client.js @@ -277,6 +277,9 @@ export function create_client(app, target) { let navigation_result = intent && (await load_route(intent)); if (!navigation_result) { + if (is_external_url(url, base)) { + return await native_navigation(url); + } navigation_result = await server_fallback( url, { id: null }, @@ -1190,7 +1193,7 @@ export function create_client(app, target) { }); } - if (__SVELTEKIT_DEV__) { + if (__SVELTEKIT_DEV__ && status !== 404) { console.error( 'An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)' );