Skip to content

[Bug]: useToolbarGroupStyles.styles.ts can create an empty CSS file #28565

@benlemmon-ms

Description

@benlemmon-ms

Library

Reac / v9 (@fluentui/react-components)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
    Memory: 96.73 GB / 127.71 GB
  Browsers:
    Edge: Spartan (44.22621.1992.0), Chromium (113.0.1774.57)
    Internet Explorer: 11.0.22621.1

Are you reporting Accessibility issue?

None

Reproduction

Unable to create repro, but do have details

Bug Description

Reproduction

Build an app using webpack, and have one chunk referencing toolbar.

Actual Behavior

A CSS file is generated with this content:
/!!
!
css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/@griffel/webpack-extraction-plugin/virtual-loader/index.js?style=!../../node_modules/@fluentui/react-toolbar/lib/components/ToolbarGroup/useToolbarGroupStyles.styles.js !
*
*/

Expected Behavior

No empty CSS. Our CDN will refuse 0-byte files.

Cause

I was able to trace this to this PR which creates an empty makeStyles call.

Logs

No response

Requested priority

Blocking

Products/sites affected

Loop

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions