You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug - react-icons - Tree-shaking broken due to missing sideEffects in dist/esm/package.json #12313
Starting in the prerelease builds, @patternfly/react-icons ships a dist/esm/package.json file containing {"type": "module"}. This file does not include the "sideEffects": false declaration that exists in the root package.json. Because webpack resolves the nearest package.json for each module, all icons under dist/esm/ are treated as having side effects, completely breaking tree-shaking.
This causes the entire icon library (all 2846 icons, ~7MB minified) to be bundled even when only a handful are used.
How do you reproduce the problem?
Install @patternfly/react-icons@6.5.0-prerelease.19 (or any recent prerelease)
Import a single icon: import { CheckCircleIcon } from '@patternfly/react-icons'
Run a webpack 5 production build
Observe that ALL icons are included in the bundle
Root cause: dist/esm/package.json contains {"type": "module"} but is missing "sideEffects": false. The root package.json has "sideEffects": false, but webpack uses the closest package.json to each module file, so the dist/esm/package.json takes precedence and the sideEffects flag is never seen.
Expected behavior
Only the imported icons should be included in the bundle. The dist/esm/package.json should include "sideEffects": false to match the root package.json:
{
"type": "module",
"sideEffects": false
}
The stable 6.4.x release does not have a dist/esm/package.json at all, so tree-shaking works correctly there.
Is this issue blocking you?
This adds ~5MB of unused icon SVG data to the production bundle. Workaround: add a webpack module rule to explicitly mark @patternfly/react-icons as side-effect-free:
What is your product and what release date are you targeting?
Console 4.23
Any other information?
This likely affects all packages in the prerelease that added dist/esm/package.json for ESM "type": "module" support. Any package that relies on "sideEffects": false in its root package.json for tree-shaking will be broken if the nested dist/esm/package.json doesn't also include that field.
#12140 - feat(TreeView): add support for disabled TreeViewListItems [merged] #12222 - feat(react-icons): add newest rh brand icons [merged] #12245 - feat(icons): add swap support for mapped rh-ui icons [merged] #12265 - fix(icons): update internal import specifier [merged] #12282 - fix: bump pf-core version 6.5.0-prerelease.55 [merged]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Activity
coderabbitai commentedon Apr 2, 2026
🔗 Related PRs
#12140 - feat(TreeView): add support for disabled TreeViewListItems [merged]
#12222 - feat(react-icons): add newest rh brand icons [merged]
#12245 - feat(icons): add swap support for mapped rh-ui icons [merged]
#12265 - fix(icons): update internal import specifier [merged]
#12282 - fix: bump pf-core version 6.5.0-prerelease.55 [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
fix(react-icons): add sideEffects: false to dist/esm/package.json
fix(react-icons): add sideEffects: false to dist/esm/package.json
fix(react-icons): add sideEffects: false to dist/esm/package.json (#1…