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

Encountering "SyntaxError: Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to parse the rule '.f10oniif{background-color:rgba(255, 255, 255, 0.5);};}'." after updating the Edge browser to version 129.0.279.52. #608

Closed
imechZhangLY opened this issue Sep 25, 2024 · 2 comments
Assignees
Labels
🐞 bug Something isn't working

Comments

@imechZhangLY
Copy link

Bug description

We are experiencing an issue where certain CSS styles are not functioning correctly in our web application after updating the Edge browser to version 129.0.279.52. We have identified a “SyntaxError” occurring when calling insertRule(). The error appears to be caused by a CSS rule with multiple closing braces, such as “.f143d684{width:calc(100% - 6.9rem);};}”.

System information

Edge: 129.0.279.52
@griffel/react: 1.5.25

Reproduce steps

You can reproduce this bug by downloading https://github.com/imechZhangLY/griffel-error-demo and following the instructions.

  1. Build the project by running npm run build.
  2. Open index.html in the dist folder using Edge version 129.0.279.52 or higher.
  3. You will see the following error in the console. If the error does not appear immediately, try refreshing the page.

image

@layershifter
Copy link
Member

layershifter commented Sep 26, 2024

As I see, it's not related to Griffel itself. Our code generates proper CSS:

image

I checked the repro and it seems to be related to the used minifier (UglifyJs), as once this line is removed:

https://github.com/imechZhangLY/griffel-error-demo/blob/d036145899a49a09f4564c939779b165ae6d3ec7/webpack.config.js#L41

There are no errors anymore. Considering that UglifyJs should not be used in production, closing the issue.

@layershifter layershifter closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2024
@layershifter layershifter self-assigned this Sep 26, 2024
@layershifter layershifter added the 🐞 bug Something isn't working label Sep 26, 2024
@ling1726
Copy link
Member

UglifyJS is no longer maintained and should not be used in production mishoo/UglifyJS#3156 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants