Skip to content

SPFx - Styles not being applied in newest version of SPFx 1.21 #10207

Open
@grantjenkins

Description

@grantjenkins

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • SPFx version 1.21 (npm install @microsoft/generator-sharepoint@latest --global)
  • Node.js version 22.15.0
  • NPM version 10.9.2
  • YO version 5.1.0
  • Visual Studio Code - 1.99.3

Describe the bug / error

After updating to the last version of SPFx, I created a base project using yo @microsoft/sharepoint with REACT framework. The base project builds and serves without any issues, except that it never picks up any styles from the XX.module.scss file. Note that I didn't make any changes to the project after it was created except updating the serve.json file.

I've tried creating multiple projects on two different computers and still the exact same issue.

Steps to reproduce

Performed the below with multiple projects across multiple computers

  1. Run: npm install @microsoft/generator-sharepoint@latest --global (once per computer)
  2. Run: yo @microsoft/sharepoint using REACT as the framework
  3. Modify the config/serve.json folder so it uses my SharePoint site URL for the workbench
  4. Run: npm build to build the project
  5. Run: npm serve
  6. Workbench loads and Add the Webpart

NO STYLES APPLIED

I also packaged the solution and added it to the App Catalog, installed the Webpart and added it to my site - same issue.

Expected behavior

The styles should be applied to the output (webpart)

Metadata

Metadata

Assignees

Labels

sharepoint-developer-supportsharepoint-developer-supporttype:bug-confirmedConfirmed bug, not working as designed / expected.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    close