From 0eb09dbab1674a57d23ac97950a527d2e5a9c9fb Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Fri, 1 Sep 2023 16:14:15 +0200 Subject: [PATCH] fix(vercel): Don't output an error message for failing to resolve sharp (#8354) * fix(vercel): Don't output an error message for failing to resolve sharp * chore: changeset --- .changeset/shy-socks-return.md | 5 +++++ packages/integrations/vercel/src/lib/nft.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/shy-socks-return.md diff --git a/.changeset/shy-socks-return.md b/.changeset/shy-socks-return.md new file mode 100644 index 000000000000..ea046be2dcb5 --- /dev/null +++ b/.changeset/shy-socks-return.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': patch +--- + +Fix unnecessary warning about Sharp showing while building diff --git a/packages/integrations/vercel/src/lib/nft.ts b/packages/integrations/vercel/src/lib/nft.ts index 6cdbe530a0ca..585a45e998dc 100644 --- a/packages/integrations/vercel/src/lib/nft.ts +++ b/packages/integrations/vercel/src/lib/nft.ts @@ -49,6 +49,9 @@ export async function copyDependenciesToFunction( // The import(astroRemark) sometimes fails to resolve, but it's not a problem if (module === '@astrojs/') continue; + // Sharp is always external and won't be able to be resolved, but that's also not a problem + if (module === 'sharp') continue; + if (entryPath === file) { console.warn( `[@astrojs/vercel] The module "${module}" couldn't be resolved. This may not be a problem, but it's worth checking.`