Skip to content

Upgrading from 5.107.2 to 5.108.1 breaks component packages which import styles #21288

Description

@jcestibariz

Have you used AI?

No

Bug Description

When I upgrade webpack from 5.107.2 to 5.108.1 the component library I'm using (@bluecateng/pelagos) no longer displays correctly because the styles are not included anymore.

Link to Minimal Reproduction and step to reproduce

https://github.com/bluecatengineering/pelagos-example

Steps:

  1. npm i
  2. npm start
  3. In the UI select "See dialog example"
  4. Notice it renders correctly
  5. Back in the CLI, stop npm
  6. npm up webpack
  7. npm start
  8. In the UI select "See dialog example"
  9. Notice it now renders incorrectly, also notice the styles are no longer applied

Expected Behavior

The styles imported from the components in the library must be included in the build assets.

Actual Behavior

The styles imported from the components in the library are no longer included in the build assets.

Environment

System:
  OS: macOS 15.7.7
  CPU: (12) arm64 Apple M2 Pro
  Memory: 570.66 MB / 32.00 GB
Binaries:
  Node: 24.15.0 - /opt/homebrew/bin/node
  npm: 11.12.1 - /opt/homebrew/bin/npm
Browsers:
  Chrome: 149.0.7827.197
  Firefox: 152.0.3
  Safari: 26.5
Packages:
  babel-loader: ^10.0.0 => 10.1.1 
  css-loader: ^7.1.1 => 7.1.4 
  less-loader: ^12.2.0 => 12.3.2 
  style-loader: ^4.0.0 => 4.0.0 
  webpack: ^5.91.0 => 5.108.1 
  webpack-cli: ^7.0.2 => 7.0.2 
  webpack-dev-server: ^5.0.4 => 5.2.3

Is this a regression?

Yes (please specify version below)

Last Working Version

5.107.2

Additional Context

Notice that the library correctly declares the styles as side effects

The incorrect behaviour may have been introduced in #21085

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions