diff --git a/.changeset/brown-eels-retire.md b/.changeset/brown-eels-retire.md new file mode 100644 index 000000000000..e4b2baaed188 --- /dev/null +++ b/.changeset/brown-eels-retire.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-vercel': patch +--- + +[fix] don't fail on unknown error message diff --git a/packages/adapter-vercel/index.js b/packages/adapter-vercel/index.js index a4dca08a570c..6ce0637d4794 100644 --- a/packages/adapter-vercel/index.js +++ b/packages/adapter-vercel/index.js @@ -315,7 +315,7 @@ async function create_function_bundle(builder, entry, dir, runtime) { if (error.message.startsWith('Failed to resolve dependency')) { const match = /Cannot find module '(.+?)' loaded from (.+)/; - const [, module, importer] = match.exec(error.message); + const [, module, importer] = match.exec(error.message) ?? [, error.message, '(unknown)']; if (!resolution_failures.has(importer)) { resolution_failures.set(importer, []);