Closed naxxateux closed 3 years ago
Seems like a strange bug in the new PostCSS 8 event system.
I will have a relocation this week, so if you want to fix it quicker, try to investigate what is happening here https://github.com/postcss/postcss-nested/blob/main/index.js#L143-L155
@ai thnx for the quickest response ever :-) I will try to investigate it next week.
@naxxateux, I can't reproduce this issue. I tried it on windows and ubuntu with different postcss parsers and bundlers, but css was always processed correctly. Can you add additional info about your environment or maybe try to reproduce issue again?
There is also similar issue here https://github.com/postcss/postcss-mixins/issues/132
And seems like here we have similar issue https://github.com/postcss/postcss-nested/issues/129
I reproduced issue.
It is very interesting that with postcss-nested@5.0.5
and postcss@8.3.0
there is no problem, but with postcss@8.3.1
(or on version lower than 8.3) issue happened.
I'll debug it and try to make PR for fix
@TheSeally very, very strange. postcss@8.3.1
changes only no plugins or parser
warning detection.
Maybe node_modules
structure somehow creates a bug.
I added tests and check on these versions of postcss: 8.3.2 8.3.1 8.3.0 8.2.15 8.2.0 8.1.3 and and all version postcss-selector-parser@6.0.x, and node 10.21, 12.18.2, 14.10.1, 16.3.0 All test passed.
@exdeniz it means that issue is with some another component. Maybe PostCSS?
@ai I had a suspicion that maybe postcss-nested was preceded by postcss-present-env with the postcss-nesting plugin. But I checked it out and it didn't check out.
Hm. We can add a warning to postcss-nested
if we will find postcss-nesting
in result.processor.plugins
@naxxateux did we have postcss-preset-env
in Amplifr?
@naxxateux And you can get a config PostCSS?
I reproduced it in https://github.com/ai/sitnik.ru project, but it reproduced only when I use yarn
Steps:
yarn
(now postcss version is 8.3.0)yarn
< >
operators)When I install deps via npm
there is no problem :)
😅 Very strange bug.
But a few people told me that they have a bug after PostCSS update. Can you find a source of problem in a broken environment?
yeah I will try to do it
I debuged a little bit and found that problem can connect with different postcss version in deps.
When I install postcss@8.3.0
with sugarss
via yarn
I have only one postcss
in deps folder, but when I install postcss@8.3.1
(via yarn
) I have two different postcss
in deps (one standalone package and one in sugarss
folder).
So because postcss
use Symbol isClean
for checking root than when we have 2 different postcss packages we have two different symbols isClean
that are not equal.
Screenshot for postcss@8.3.0
Screenshot for postcss@8.3.1
We can use global Symbol via Symbols.for
in symbols.js
file in postcss
this will fix problem with different postcss
versions, but I don't know is it good decision.
https://github.com/postcss/postcss/blob/2da5501f709862c19e7103b81ba8fb224a5793ff/lib/symbols.js#L3
@ai what do you think about this?
Wow, great! It looks very obvious now.
I will think about solution. Maybe it is better to switch to string key.
I will mark you as a solver for Cult of Martians task. What is your Twitter account for future @postcss
tweet?
Thanks, my twitter link https://twitter.com/autumn_poet
@TheSeally I made 2 fixes:
postcss
in peerDependencies
(but it will take a few weeks to release new versions) https://github.com/postcss/postcss/commit/714c5c6263f5930a5ef0c1704bbc707db9581ed5Can I ask you to test the second fix?
postcss
) node_modules/postcss/container.js
, node_modules/postcss/lazy-result.js
and node_modules/postcss/symbols.js
with a version from GitHub’s main
branch.@ai after replacing scripts in standalone package, css is processed correctly
Fixed with PostCSS 8.3.3.
Guys, thnx for investigation and fix. Sorry for not responding — I was on vacation :-)
Hi!
Just updated postcss-nested to v. 5.0.5 (from 5.0.3) and got this issue.
This is my .sss file:
And I got this as a result:
What seems to be the problem here? And how can I fix it properly? Thnx in advance.