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

removeUnusedAtRules exception #1252

Open
andrewgoz opened this issue May 24, 2023 · 0 comments
Open

removeUnusedAtRules exception #1252

andrewgoz opened this issue May 24, 2023 · 0 comments

Comments

@andrewgoz
Copy link

I'm using html-minifier-terser 7.2.0 which includes clean-css 5.3 with node 18.12.0 on Windows 10. When I attempt to minify:

<!doctype html>
<html><head><title>Test</title>
<style>
@keyframes test {
   0% {rotate:  0deg;}
 100% {rotate:360deg;}
}
:root {
  --test-anim: 1s test;
}
p:hover {
  animation: var(--test-anim);
}
</style>
<body><p style="position:absolute">Hover me!</p></body>
</html>

I get the message:

clean-css\lib\optimizer\level-2\remove-unused-at-rules.js:194
        for (j = 0, m = component.value.length; j < m; j++) {
                                  ^
TypeError: Cannot read properties of undefined (reading 'value')

and no output file is produced.

For my configuration I have level 2 "all" set to true. If I add "removeUnusedAtRules:false" the problem goes away.

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

1 participant