Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip candidates with invalid theme() calls #14437

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

thecrypticace
Copy link
Contributor

Right now when we encounter a candidates with invalid theme() calls we throw an error which stops the build entirely. This is not ideal because, especially in the case of node_modules, if one file in one package has an error it will stop the build for an entire project and tracking this down can be quite difficult.

Now, after this PR, any candidates that use theme(…) with non-existent theme keys (e.g. rounded-[theme(--radius-does-not-exist)]) will be skipped instead of breaking the build.

Before:

<div class="underline rounded-[theme(--radius-does-not-exist)]"></div>
/* No CSS was generated because an error was thrown */
/* Error: Invalid theme key: --radius-does-not-exist */

After:

<div class="underline rounded-[theme(--radius-does-not-exist)]"></div>
.underline {
  text-decoration-line: underline;
}

thecrypticace and others added 3 commits September 17, 2024 12:33
…e()` calls

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
Update changelog
@thecrypticace thecrypticace force-pushed the fix/v4-no-throw-on-theme-in-candidate branch from b4e83e8 to ea69d99 Compare September 17, 2024 16:33
@thecrypticace thecrypticace merged commit cb5b7b4 into next Sep 17, 2024
3 checks passed
@thecrypticace thecrypticace deleted the fix/v4-no-throw-on-theme-in-candidate branch September 17, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants