Skip to content

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
@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.

4 participants