Skip to content

Commit

Permalink
[fix] don't fail on unknown error message (#7312)
Browse files Browse the repository at this point in the history
Fixes #7245
  • Loading branch information
dummdidumm authored Oct 19, 2022
1 parent e934bc8 commit 8d83708
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brown-eels-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-vercel': patch
---

[fix] don't fail on unknown error message
2 changes: 1 addition & 1 deletion packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, []);
Expand Down

0 comments on commit 8d83708

Please sign in to comment.