-
Notifications
You must be signed in to change notification settings - Fork 1k
SPFx 1.21 - SCSS/CSS Module hashes being applied twice, styling not working #10205
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
Comments
We have the same issue - I hoped it was related with this issue #10053 and would be resolved in the GA version. |
Hello @akarlsten, |
@akarlsten, Are there special circumstances in which styling is not working, please give me some reference code in this case. |
@Ashlesha-MSFT please see the latest comment of @thechriskent in this ticket #10053 (comment), which is the exact steps to reproduce this issue. Did you use *.module.scss files to style your sample webpart? |
@akarlsten, |
SharePoint Framework 1.21.1 is now out to address this one. If you could confirm that the issue is fixed for you, that would be awesome - thanks for reporting this and sharing issues which we should address 🙏🧡 Release notes for 1.21.1 at https://learn.microsoft.com/en-us/sharepoint/dev/spfx/release-1.21.1 |
@akarlsten, As the issue is resolved |
Closing the issue as it was also confirmed to be fixed in the duplicate issue. Thanks for everyone for reporting this and we do apologize inconvenience this might have caused. Please keep on flagging any issues as previously, so that we can start resolving them as fast as possible 🙏👍 |
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Linux
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
We've been developing a new SPFx solution and went ahead and started with the 1.21 RC (and since yesterday, the actual release version) - everything was working fine while serving in development, but when we tried to deploy it live in production none of our styles were being applied.
After some fiddling around we noticed that the generated minified css in the .js bundle (in /dist) had names like .app_{hash}_{hash} while the actual elements had classnames like .app_{hash}. In /lib everything looked like it should (with just .app_{hash} on both elements and css styles), which is presumably why everything looked good in development.
After some more rooting around we figured the first set of hashes was being applied by the
sass
step of the build chain, then later on thewebpack
step added another set of its own.We've managed to work around it by setting the following in our
gulpfile.js
:Did we miss something or is this a bug?
Steps to reproduce
Expected behavior
The styles should be applied both in dev and prod!
The text was updated successfully, but these errors were encountered: