diff --git a/.changeset/immaculate-error-handler.md b/.changeset/immaculate-error-handler.md new file mode 100644 index 000000000000..bc16312babbc --- /dev/null +++ b/.changeset/immaculate-error-handler.md @@ -0,0 +1,6 @@ +--- +'@sveltejs/adapter-vercel': patch +--- + +Ignore warnings when traced file fails to parse + diff --git a/packages/adapter-vercel/index.js b/packages/adapter-vercel/index.js index 37027c836f7a..071d025e760e 100644 --- a/packages/adapter-vercel/index.js +++ b/packages/adapter-vercel/index.js @@ -308,6 +308,11 @@ async function create_function_bundle(builder, entry, dir, runtime) { // pending https://github.com/vercel/nft/issues/284 if (error.message.startsWith('Failed to resolve dependency node:')) return; + // 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 + if (error.message.startsWith('Failed to parse')) return; + if (error.message.startsWith('Failed to resolve dependency')) { const match = /Cannot find module '(.+?)' loaded from (.+)/; const [, module, importer] = match.exec(error.message);