From a467139e169ad2eb7931e03004f1d658f7362e59 Mon Sep 17 00:00:00 2001 From: Andrea De Masi Date: Mon, 19 Dec 2022 19:07:00 +0100 Subject: [PATCH] fix traced warnings from unexpected token (#5638) * fix traced warnings from unexpected token * Fixed styling --- .changeset/lazy-tomatoes-call.md | 5 +++++ packages/integrations/vercel/src/lib/nft.ts | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/lazy-tomatoes-call.md diff --git a/.changeset/lazy-tomatoes-call.md b/.changeset/lazy-tomatoes-call.md new file mode 100644 index 000000000000..e36f95d01de9 --- /dev/null +++ b/.changeset/lazy-tomatoes-call.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': minor +--- + +Ignore warnings when traced file fails to parse diff --git a/packages/integrations/vercel/src/lib/nft.ts b/packages/integrations/vercel/src/lib/nft.ts index 6a9ac116eeeb..46604db902ac 100644 --- a/packages/integrations/vercel/src/lib/nft.ts +++ b/packages/integrations/vercel/src/lib/nft.ts @@ -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; }