Skip to content

Commit

Permalink
fix traced warnings from unexpected token (#5638)
Browse files Browse the repository at this point in the history
* fix traced warnings from unexpected token

* Fixed styling
  • Loading branch information
andreademasi committed Dec 19, 2022
1 parent 783a2a8 commit a467139
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-tomatoes-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': minor
---

Ignore warnings when traced file fails to parse
6 changes: 6 additions & 0 deletions packages/integrations/vercel/src/lib/nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export async function copyDependenciesToFunction({
`[@astrojs/vercel] The module "${module}" inside the file "${file}" couldn't be resolved. This may not be a problem, but it's worth checking.`
);
}
}
// parse errors are likely not js and can safely be ignored,
// such as this html file in "main" meant for nw instead of node:
// https://github.com/vercel/nft/issues/311
else if (error.message.startsWith('Failed to parse')) {
continue;
} else {
throw error;
}
Expand Down

0 comments on commit a467139

Please sign in to comment.