diff --git a/.changeset/warm-impalas-thank.md b/.changeset/warm-impalas-thank.md new file mode 100644 index 000000000000..190158262df6 --- /dev/null +++ b/.changeset/warm-impalas-thank.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +chore: deprecate `preloadCode` calls with multiple arguments diff --git a/packages/kit/src/runtime/client/client.js b/packages/kit/src/runtime/client/client.js index d84a48e28834..c9216056da92 100644 --- a/packages/kit/src/runtime/client/client.js +++ b/packages/kit/src/runtime/client/client.js @@ -277,6 +277,10 @@ export function create_client(app, target) { /** @param {...string} pathnames */ async function preload_code(...pathnames) { + if (DEV && pathnames.length > 1) { + console.warn('Calling `preloadCode` with multiple arguments is deprecated'); + } + const matching = routes.filter((route) => pathnames.some((pathname) => route.exec(pathname))); const promises = matching.map((r) => {