-
Notifications
You must be signed in to change notification settings - Fork 1
Fix error with empty style definitions json file #113
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
Conversation
An artifact in our own codebase could sometimes cause empty style definitions json files. This will fail compilation of ex_css_modules because decoding an empty string is not working. To capture this edge case, let's check if the file is empty before trying to decode OR generate the json file through a task.
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #113 +/- ##
==========================================
+ Coverage 91.89% 93.47% +1.58%
==========================================
Files 2 2
Lines 37 46 +9
==========================================
+ Hits 34 43 +9
Misses 3 3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Raise a compile error with custom message if the JSON file is empty or absent, explaining what to do to be able to compile again.
ddfed67 to
c626d84
Compare
It should check for the json to be empty, not the stylesheet. (Stylesheet was also empty, that's why the test would pass.) Co-authored-by: Matthijs Kuiper <info@matthijskuiper.nl>
If the task does not exist, a compilation error will be thrown.
|
Tested in detroit with this branch. Added Nice! |
Yes! That will be done in https://github.com/DefactoSoftware/detroit/pull/13193 :D |
An artifact in our own codebase could sometimes cause empty style definitions json files. This will fail compilation of ex_css_modules because decoding an empty string is not working.
To capture this edge case, let's check if the file is empty before trying to decode OR generate the json file through a task.