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

refactor: tailwindcss compilation error #776

Merged
merged 1 commit into from
Oct 1, 2022

Conversation

cossssmin
Copy link
Member

This PR changes the way an error is thrown when Tailwind CSS or PostCSS compilation fails by removing the console.error and throwing a SyntaxError instead of a plain Error.

Given something like this in your tailwind.css file:

.example {
  @apply test;
}

The build will now fail with a SyntaxError that makes clearer where the issue occured:

✖ CssSyntaxError: C:\projects\maizzle\src\css\tailwind.css:2:3: The `test` class does not exist. If `test` is a custom class, make sure it is defined within a `@layer` directive.

  1 | .example {
> 2 |   @apply test;
    |   ^
  3 | }
  4 |

throw SyntaxError, remove console.error
@cossssmin cossssmin merged commit ba80622 into master Oct 1, 2022
@cossssmin cossssmin deleted the refactor-tailwind-generator branch October 1, 2022 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant