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

[Bug] "defaultClassNamePrefix" set to undefined in production #901

Closed
kof opened this issue Oct 23, 2018 · 7 comments
Closed

[Bug] "defaultClassNamePrefix" set to undefined in production #901

kof opened this issue Oct 23, 2018 · 7 comments
Labels
bug It went crazy and killed everyone. complexity:low You can fix it, c'mon! important The thing you do when you wake up!

Comments

@kof
Copy link
Member

kof commented Oct 23, 2018

From @VintorezVS on October 23, 2018 6:0

Custom "classNamePrefix" concatenated with "defaultClassNamePrefix" in production gives "customprefix-undefinedXXX" class names.

...
const defaultClassNamePrefix = env === 'production' ? undefined : `${displayName}-`
...
let classNamePrefix = defaultClassNamePrefix
...
if (contextSheetOptions && contextSheetOptions.classNamePrefix) {
    classNamePrefix = contextSheetOptions.classNamePrefix + classNamePrefix
}
...

Copied from original issue: cssinjs/react-jss#304

@kof
Copy link
Member Author

kof commented Oct 23, 2018

thanks for the report

@kof kof added bug It went crazy and killed everyone. complexity:low You can fix it, c'mon! labels Oct 23, 2018
@HenriBeck
Copy link
Member

So instead of undefined let's just use an empty string or would this break something as well?

@kof
Copy link
Member Author

kof commented Oct 23, 2018

I think it would be fine, wanna send a PR?

@HenriBeck
Copy link
Member

This should already be fixed: 1e9ba74#diff-15944e28391ef80a3f4e34ea8a2193f4R99

@kof
Copy link
Member Author

kof commented Oct 24, 2018

true, @VintorezVS subscribe #795 for notifications when v10 will be published

@kof kof closed this as completed Oct 24, 2018
@airtonix
Copy link

airtonix commented Jun 27, 2019

Why is it even undefined in the first place? I mean, why in production is sheet.options.classNamePrefix not there? what do I change to make it be there.

We want the same classnames generated in dev and prod.

@kof kof added the important The thing you do when you wake up! label Jun 27, 2019
@micaste
Copy link

micaste commented Sep 9, 2019

@airtonix my understanding is that classNamePrefix stays in production. What was undefined in PROD and has been replaced by an empty string is displayName.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It went crazy and killed everyone. complexity:low You can fix it, c'mon! important The thing you do when you wake up!
Projects
None yet
Development

No branches or pull requests

4 participants