sveltejs/kit · warning

Preloading data for ${intent.url.pathname} failed with the f

Error message

Preloading data for ${intent.url.pathname} failed with the following error: ${error.message}
If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. This route was preloaded due to a data-sveltekit-preload-data attribute. See https://svelte.dev/docs/kit/link-options for more info

What it means

In dev mode, when speculative data preloading (triggered by data-sveltekit-preload-data, e.g. the default 'tap' or hover preloading) fails, SvelteKit catches the rejection and logs this console warning instead of crashing. It tells you the preload failed and suggests disabling preloading for that route if it is not transient.

Source

Thrown at packages/kit/src/runtime/client/client.js:2477

		if (external || download) return;

		const options = get_router_options(a);

		// we don't want to preload data for a page we're already on
		const same_url = url && get_page_key(current.url) === get_page_key(url);
		if (options.reload || same_url) return;

		if (priority <= options.preload_data) {
			current_a = { element: a, href: a.href };
			// we don't want to preload data again on tap if we've already preloaded it on hover
			current_priority = PRELOAD_PRIORITIES.tap;

			const intent = await get_navigation_intent(url, false);
			if (!intent) return;

			if (DEV) {
				void _preload_data(intent).catch((error) => {
					console.warn(
						`Preloading data for ${intent.url.pathname} failed with the following error: ${error.message}\n` +
							'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' +
							'This route was preloaded due to a data-sveltekit-preload-data attribute. ' +
							'See https://svelte.dev/docs/kit/link-options for more info'
					);
				});
			} else {
				void _preload_data(intent);
			}
		} else if (priority <= options.preload_code) {
			current_a = { element: a, href: a.href };
			current_priority = priority;
			void _preload_code(/** @type {URL} */ (url));
		}
	}

	function after_navigate() {
		observer.disconnect();

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Fix the underlying error in the load function / endpoint shown in error.message.
  2. If preloading is inappropriate for the route, set data-sveltekit-preload-data="off" on the link (or a parent).
  3. Ignore it if transient — the real navigation will retry and handle the error properly.

Example fix

// before
<a href="/dashboard" data-sveltekit-preload-data="hover">Dashboard</a>
// after (endpoint errors on preload)
<a href="/dashboard" data-sveltekit-preload-data="off">Dashboard</a>
Defensive patterns

Strategy: try-catch

Try / catch

// already caught by the framework; mirror it in app code:
try {
  await preload(intent);
} catch (error) {
  console.warn(`Preload for ${intent.url.pathname} failed: ${error.message}`); // non-fatal
}

Prevention

When it happens

Trigger: Hovering/tapping a link with data-sveltekit-preload-data whose load function or server endpoint throws or returns a network error while running `vite dev`.

Common situations: Preloading a link whose load depends on a not-yet-authenticated request, a flaky API, or a server route that 500s; the warning appears in the browser console even though navigation would surface the error properly.

Related errors


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/1d5768cb691f960b. Report an issue: GitHub.