-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Illegal classname generation in Firefox #2614
Comments
@srmagura would you be so kind to take a look at this one? This is definitely related to the label extraction thing. |
Thanks for the ping. It is clearly an issue with label extraction. I just rendered a @hoangbn I should be able to fix this quickly if we can get a minimal repro. Can you either (A) create a minimal repro yourself or (B) answer some questions so I can try to repro? For (A), you would need to create a new React application that uses the exact same build tools & configuration as your real app where this is happening. For (B):
|
@srmagura Here's the repo: https://github.com/hoangbn/emotion-issue-2614. I also noticed the classname is correctly generated in production ( |
Thanks a lot! I can reproduce it.
If you look at var Loader = /** @class */ (function (_super) {
__extends(Loader, _super);
function Loader() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.style = function (i) {
var _a = _this.props, color = _a.color, width = _a.width, height = _a.height, margin = _a.margin, radius = _a.radius, speedMultiplier = _a.speedMultiplier;
return react_1.css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n width: ", ";\n height: ", ";\n margin: ", ";\n border-radius: ", ";\n display: inline-block;\n animation: ", " ", "s ", "s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation-fill-mode: both;\n "], ["\n background-color: ", ";\n width: ", ";\n height: ", ";\n margin: ", ";\n border-radius: ", ";\n display: inline-block;\n animation: ", " ", "s ", "s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation-fill-mode: both;\n "])), color, helpers_1.cssValue(width), helpers_1.cssValue(height), helpers_1.cssValue(margin), helpers_1.cssValue(radius), scale, 1 / speedMultiplier, i * 0.1);
};
return _this;
}
Loader.prototype.render = function () {
var _a = this.props, loading = _a.loading, css = _a.css;
return loading ? (react_1.jsx("span", { css: [css] },
react_1.jsx("span", { css: this.style(1) }),
react_1.jsx("span", { css: this.style(2) }),
react_1.jsx("span", { css: this.style(3) }),
react_1.jsx("span", { css: this.style(4) }),
react_1.jsx("span", { css: this.style(5) }))) : null;
};
Loader.defaultProps = helpers_1.heightWidthRadiusDefaults(35, 4, 2);
return Loader;
}(React.PureComponent)); I should have a PR ready for this on Monday (don't have a Mac at home). |
…efox (#2615) * Fix getLabelFromStackTrace edge case in Firefox Closes #2614. * Update .changeset/spotty-clouds-listen.md Co-authored-by: Mateusz Burzyński <[email protected]>
Current behaviour:
I am seeing illegal class names being generated in Firefox, making the browser not render those styles.
Chrome:

Firefox:


To reproduce:
This code is produced by the https://github.com/davidhu2000/react-spinners package (in particular https://github.com/davidhu2000/react-spinners/blob/master/src/ScaleLoader.tsx), but I cannot currently reproduce this on a fresh repo.
Any idea why this could potentially happen, and where I should look for it would be appreciated.
Expected behaviour:
Class names being generated in Firefox should have the same pattern as in Chrome.
Environment information:
react
version: 17.0.2@emotion/react
version: 11.7.1The text was updated successfully, but these errors were encountered: