Closed silvanaweb closed 1 year ago
I spent a day to find this out also.
I had the same problem.
I just got the same thing today, too.
My jest test bombs out with the same error on the same line.
In my case, compileSelector
is called with expression
= '.makeStyles-root _:-ms-fullscreen'
.
The parser gets stuck in an endless cycle with selector
= ' _:-ms-fullscreen'
(note the leading space):
while
loop, symbol
is a space, so matches the 'Descendant combinator' casematch
is set to [' _:-ms-fullscreen', '_:-ms-fullscreen']
, source
is set to a string that embeds itselfwhile
loop, selector
is set to match.pop()
i.e. '_:-ms-fullscreen'
(no leading space).while
loop, symbol
is set to _
while
loop, selector
is set to match.pop()
i.e. ' _:-ms-fullscreen'
(with leading space)selector
at the start of the cycle, so the cycle repeats.
On each cycle the source
string grows, eventually exhausting memory.NOTE: the recommendation for using '_:-ms-fullscreen'
comes from here:
https://stackoverflow.com/questions/45973976/apply-only-to-ie-11-within-media-query-for-screen-size
The full string is created by Material-UI V4 CSS compiler .
I'm not sure if it is valid CSS, as _
is not a valid tagname, but in any case nwsapi should not crash.
Seems that this error will occur whenever there is a space followed by an invalid selector.
Turns out issue #46 is the exact problem I described above
@silvanaweb / @richard-ling Your issues should have been solved by this commit: https://github.com/dperini/nwsapi/commit/12f9f59c2dc53f8c86cd8f19fe64116ca2adc638 it is part of the 2.2.3 release.
Closing this issue.
While using react testing library that uses this library, I have encountered a difficult-to-find error when running unit tests that were just breaking and showing the following message:
After hours of investigation, I have found out that one of the React styled components I was using had a tiny mistake in its styles. Something like:
Where a character was out of the parenthesis.