diff --git a/.changeset/twenty-monkeys-glow.md b/.changeset/twenty-monkeys-glow.md new file mode 100644 index 000000000000..9a3d4d1a5eb4 --- /dev/null +++ b/.changeset/twenty-monkeys-glow.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Improve error message when prefetching fails diff --git a/packages/kit/src/runtime/client/client.js b/packages/kit/src/runtime/client/client.js index 837fdf389ada..70287c9106a1 100644 --- a/packages/kit/src/runtime/client/client.js +++ b/packages/kit/src/runtime/client/client.js @@ -199,7 +199,7 @@ export function create_client({ target, base, trailing_slash }) { const intent = get_navigation_intent(url, false); if (!intent) { - throw new Error('Attempted to prefetch a URL that does not belong to this app'); + throw new Error(`Attempted to prefetch a URL that does not belong to this app: ${url}`); } load_cache = { id: intent.id, promise: load_route(intent) };