Skip to content

Commit c655125

Browse files
committed
Don’t log resolution failure messages
These are expected if you are just using the plain `tailwindcss` package or don’t have `tailwindcss` installed locally at all — for example when using the Standalone CLI. Other errors should be surfaced though as they could indicate a problem.
1 parent 341d475 commit c655125

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/tailwindcss-language-server/src/project-locator.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,22 @@ async function* detectContentFiles(
673673
yield `${base}/${pattern}`
674674
}
675675
} catch (err) {
676-
console.log({ err })
676+
if (isResolutionError(err)) return
677+
678+
console.error(err)
677679
}
678680
}
679681

682+
function isResolutionError(err: unknown): boolean {
683+
return (
684+
err &&
685+
typeof err === 'object' &&
686+
'message' in err &&
687+
typeof err.message === 'string' &&
688+
err.message.includes("Can't resolve")
689+
)
690+
}
691+
680692
type ContentItem =
681693
| { kind: 'file'; file: string }
682694
| { kind: 'raw'; content: string }

0 commit comments

Comments
 (0)