{"record":{"id":"1d5768cb691f960b","repo":"sveltejs/kit","slug":"preloading-data-for-intent-url-pathname-failed","errorCode":null,"errorMessage":"Preloading data for ${intent.url.pathname} failed with the following error: ${error.message}\nIf 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","messagePattern":"Preloading data for (.+?) failed with the following error: (.+?)\nIf 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","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/kit/src/runtime/client/client.js","lineNumber":2477,"sourceCode":"\t\tif (external || download) return;\n\n\t\tconst options = get_router_options(a);\n\n\t\t// we don't want to preload data for a page we're already on\n\t\tconst same_url = url && get_page_key(current.url) === get_page_key(url);\n\t\tif (options.reload || same_url) return;\n\n\t\tif (priority <= options.preload_data) {\n\t\t\tcurrent_a = { element: a, href: a.href };\n\t\t\t// we don't want to preload data again on tap if we've already preloaded it on hover\n\t\t\tcurrent_priority = PRELOAD_PRIORITIES.tap;\n\n\t\t\tconst intent = await get_navigation_intent(url, false);\n\t\t\tif (!intent) return;\n\n\t\t\tif (DEV) {\n\t\t\t\tvoid _preload_data(intent).catch((error) => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`Preloading data for ${intent.url.pathname} failed with the following error: ${error.message}\\n` +\n\t\t\t\t\t\t\t'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' +\n\t\t\t\t\t\t\t'This route was preloaded due to a data-sveltekit-preload-data attribute. ' +\n\t\t\t\t\t\t\t'See https://svelte.dev/docs/kit/link-options for more info'\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tvoid _preload_data(intent);\n\t\t\t}\n\t\t} else if (priority <= options.preload_code) {\n\t\t\tcurrent_a = { element: a, href: a.href };\n\t\t\tcurrent_priority = priority;\n\t\t\tvoid _preload_code(/** @type {URL} */ (url));\n\t\t}\n\t}\n\n\tfunction after_navigate() {\n\t\tobserver.disconnect();","sourceCodeStart":2459,"sourceCodeEnd":2495,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/client/client.js#L2459-L2495","documentation":"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.","triggerScenarios":"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`.","commonSituations":"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.","solutions":["Fix the underlying error in the load function / endpoint shown in error.message.","If preloading is inappropriate for the route, set data-sveltekit-preload-data=\"off\" on the link (or a parent).","Ignore it if transient — the real navigation will retry and handle the error properly."],"exampleFix":"// before\n<a href=\"/dashboard\" data-sveltekit-preload-data=\"hover\">Dashboard</a>\n// after (endpoint errors on preload)\n<a href=\"/dashboard\" data-sveltekit-preload-data=\"off\">Dashboard</a>","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// already caught by the framework; mirror it in app code:\ntry {\n  await preload(intent);\n} catch (error) {\n  console.warn(`Preload for ${intent.url.pathname} failed: ${error.message}`); // non-fatal\n}","preventionTips":["Set data-sveltekit-preload-data=\"off\" on links whose load functions have side effects or depend on volatile state.","Make load functions resilient (no throw) for transient API failures during preloads.","Check the browser console for the accompanying error.message to find the failing route."],"tags":["preload","dev","console","navigation"],"backgroundTag":"preload-data-failed","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}