porsager/bss

Debug mode makes bugs harder to find

tqc opened this issue · 1 comments

tqc commented

I just spent an afternoon tracking down an elusive bug to the following code

<span className={b.fw(600).c('rgba(0, 0, 0, 0.7').class}>{children}</span>

When rules are added with sheet.insertRule, the only effect is the invalid color rule not being applied.

When in debug mode (which was turned on in an unrelated part of the codebase), all subsequent rules are inside the unclosed color rule, which breaks everything except the component containing the bug.

Hi @tqc . That's a very good point! Sorry to hear you've been bitten by that. I haven't been using debug mode myself much since I don't use dev tools, but this is definitely something that should be improved upon. I'll try to think of a good way to isolate each definition set or perhaps validate props & values.