diff --git a/.changeset/large-tables-breathe.md b/.changeset/large-tables-breathe.md new file mode 100644 index 000000000000..d002c29d7841 --- /dev/null +++ b/.changeset/large-tables-breathe.md @@ -0,0 +1,6 @@ +--- +'@sveltejs/adapter-netlify': patch +'@sveltejs/adapter-vercel': patch +--- + +chore: throw helpful migration error diff --git a/packages/adapter-netlify/index.js b/packages/adapter-netlify/index.js index 025636e9487f..d2033d7a47ef 100644 --- a/packages/adapter-netlify/index.js +++ b/packages/adapter-netlify/index.js @@ -39,6 +39,13 @@ export default function ({ split = false, edge = edge_set_in_env_var } = {}) { name: '@sveltejs/adapter-netlify', async adapt(builder) { + if (!builder.routes) { + throw new Error( + '@sveltejs/adapter-netlify >=2.x (possibly installed through @sveltejs/adapter-auto) requires @sveltejs/kit version 1.5 or higher. ' + + 'Either downgrade the adapter or upgrade @sveltejs/kit' + ); + } + const netlify_config = get_netlify_config(); // "build" is the default publish directory when Netlify detects SvelteKit diff --git a/packages/adapter-vercel/index.js b/packages/adapter-vercel/index.js index 20d4a9772dbc..16080fb8dcca 100644 --- a/packages/adapter-vercel/index.js +++ b/packages/adapter-vercel/index.js @@ -26,6 +26,13 @@ const plugin = function (defaults = {}) { name: '@sveltejs/adapter-vercel', async adapt(builder) { + if (!builder.routes) { + throw new Error( + '@sveltejs/adapter-vercel >=2.x (possibly installed through @sveltejs/adapter-auto) requires @sveltejs/kit version 1.5 or higher. ' + + 'Either downgrade the adapter or upgrade @sveltejs/kit' + ); + } + const dir = '.vercel/output'; const tmp = builder.getBuildDirectory('vercel-tmp');