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

After updating tailwindcss to 3.3.1 this plugin caused an infinite build #31

Open
remorses opened this issue Apr 9, 2023 · 4 comments

Comments

@remorses
Copy link

remorses commented Apr 9, 2023

With latest tailwindcss@3.3.1 this package caused an infinite build time with 100% CPU usage

This may be a similar issue to #20

@remorses
Copy link
Author

remorses commented Apr 9, 2023

The problem is in isAlreadyNested: https://github.com/saulhardman/postcss-hover-media-feature/blob/master/index.js#L43

Maybe a quick fix would be to limit how many times run the while loop and stop

@saulhardman
Copy link
Owner

Hi @remorses, thanks for creating an issue 🙏 I'll take a look into the cause of the infinite loop – perhaps we need to use an alternative method for checking whether a rule is already nested within the media query. I'll update the issue when I know more and hopefully we can find a solution beyond restriction the number of loop cycles.

@saulhardman
Copy link
Owner

@remorses would you be able to provide an example project that exhibits this issue?

@remorses
Copy link
Author

remorses commented Apr 11, 2023

Thank you for the quick reply 🙏

Here is a reproduction: https://stackblitz.com/edit/node-jzchab?file=package.json

After you run npm run repro postcss will run forever

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

No branches or pull requests

2 participants