Skip to content

[charts] Fix empty @mui/x-charts-vendor published package - #23310

Merged
JCQuintas merged 1 commit into
mui:masterfrom
JCQuintas:fix-charts-vendor-empty-publish
Aug 6, 2026
Merged

JCQuintas merged 1 commit into
mui:masterfrom
JCQuintas:fix-charts-vendor-empty-publish

Conversation

@JCQuintas

Copy link
Copy Markdown
Member

Fixes #23309

@mui/x-charts-vendor@9.11.0 was published with only package.json and README.md (2 files, 8 KB, versus 354 files at 9.4.0). Every vendored entry point is missing, so @mui/x-charts@9.11.0 fails at runtime.

Root cause

pnpm 11.13.0 (pnpm/pnpm#12878) made pnpm pack inherit ancestor ignore files when packing a workspace package. The repository crossed that version in #23177.

x-charts-vendor sets publishConfig.directory: "build", so the packlist root is packages/x-charts-vendor/build. pnpm's guard that disables inheritance when a package declares its own .npmignore checks the packlist root, and build/ has none since scripts/build.mjs wipes and regenerates it. So packages/x-charts-vendor/.npmignore is applied relative to build/ instead of the package root:

/*        excludes every d3-*.js / .mjs / .d.ts and lib-vendor/
!/build   matches nothing, there is no build/build

Only the files npm always force-includes survive, which is exactly package.json and README.md.

The package is version-decoupled and was last published at 9.4.0, before the pnpm bump. #23075 changed its package.json, so lerna bumped it to 9.11.0 and it was packed under the new pnpm for the first time. It is the only package in the repository with an .npmignore, so no other 9.11.0 package is affected.

Same class of regression as mui/material-ui#48934.

Changes

  • Declare an explicit files allowlist in the generated build/package.json. It takes precedence over inherited ignore files (pnpm/pnpm#13231).
  • Remove the obsolete packages/x-charts-vendor/.npmignore. publishConfig.directory already restricts what is packed, and no sibling package has one.

Both changes are needed. Removing .npmignore alone yields 330 files, because the root .gitignore is then inherited and its dist/ rule silently drops the 24 lib-vendor/*/dist files that 9.4.0 shipped.

Verification

Built and packed at tag v9.11.0 with pnpm 11.17.0:

  • before: 2 files
  • after: 354 files, matching 9.4.0
  • require('@mui/x-charts-vendor/d3-scale') and import of the vendored entry points both resolve from the packed tarball

Follow-up

@mui/x-charts-vendor@9.11.0 cannot be overwritten on npm, so it needs a 9.11.1 republish. @mui/x-charts@9.11.0 depends on ^9.11.0, so fresh installs recover without a charts release. Deprecating 9.11.0 would stop new installs landing on it.

`@mui/x-charts-vendor@9.11.0` shipped only `package.json` and `README.md`,
which breaks `@mui/x-charts@9.11.0` at runtime.

pnpm 11.13.0 (pnpm/pnpm#12878) made `pnpm pack` inherit ancestor ignore files
when packing a workspace package. Because `publishConfig.directory` points at
`build`, the packlist root is `packages/x-charts-vendor/build`, so the guard
that skips inheritance when the package has its own `.npmignore` never fires,
and `packages/x-charts-vendor/.npmignore` is applied relative to `build`
instead. Its `/*` rule then excludes every build artifact, leaving only the
files npm always force-includes.

The package was last published at 9.4.0, before the pnpm bump, so the
regression stayed hidden until mui#23075 changed the package and triggered a
republish.

Declare an explicit `files` allowlist in the generated `build/package.json`,
which takes precedence over inherited ignore files, and drop the now obsolete
`.npmignore`. Deleting `.npmignore` alone is not enough: the root `.gitignore`
is inherited too and its `dist/` rule would silently drop the 24
`lib-vendor/*/dist` files that 9.4.0 shipped.

Verified against v9.11.0: `pnpm pack` produces 354 files, matching 9.4.0, and
both `require` and `import` of the vendored entry points resolve.
@JCQuintas JCQuintas added type: regression A bug, but worse, it used to behave as expected. scope: charts Changes related to the charts. labels Aug 6, 2026
@JCQuintas JCQuintas self-assigned this Aug 6, 2026
@JCQuintas
JCQuintas requested a review from LukasTy August 6, 2026 13:59
@code-infra-dashboard

code-infra-dashboard Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-23310--material-ui-x.netlify.app/
QR code for https://deploy-preview-23310--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 0B(0.00%) 0B(0.00%)
@mui/x-scheduler-premium 0B(0.00%) 0B(0.00%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,713.05 ms +122.36 ms(+7.7%) | Renders: 63 (+0) | Paint: 2,288.14 ms +146.96 ms(+6.9%)

Test Duration Renders
LineChart stacked area with multiple series 420.25 ms 🔺+91.23 ms(+27.7%) 2 (+0)
LineChart with big data amount (with marks) 106.37 ms 🔺+38.95 ms(+57.8%) 2 (+0)
LineChart with date axis and big data amount 53.91 ms 🔺+17.65 ms(+48.7%) 2 (+0)
RadialLineChart with big data amount 68.12 ms 🔺+16.67 ms(+32.4%) 2 (+0)
ScatterChartPro with big data amount and zoomed in (batch renderer) 33.10 ms 🔺+9.30 ms(+39.1%) 2 (+0)

…and 7 more (+14 within noise) — details

Metric alarms

Test Metric Change
LineChart stacked area with multiple series bench:paint 🔺 +92.88 ms
LineChart with big data amount (with marks) bench:paint 🔺 +60.10 ms
LineChart with date axis and big data amount bench:paint 🔺 +16.00 ms
ScatterChartPro with big data amount and zoomed in (batch renderer) bench:paint 🔺 +12.93 ms

Check out the code infra dashboard for more information about this PR.

@JCQuintas
JCQuintas enabled auto-merge (squash) August 6, 2026 14:03
@JCQuintas
JCQuintas merged commit aa7b5a4 into mui:master Aug 6, 2026
25 checks passed
@JCQuintas
JCQuintas deleted the fix-charts-vendor-empty-publish branch August 6, 2026 14:16

// Without an allowlist, the packer falls back to inherited ignore files, and the whole build
// output matches the repository `.gitignore` (`build/`, `dist/`). See https://github.com/pnpm/pnpm/pull/13231
buildPkg.files = ['*.js', '*.mjs', '*.d.ts', 'lib-vendor'];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth, this change isn't necessary.
Removing .npmrc is enough, since publish config already points to the build folder:

"publishConfig": {
"access": "public",
"directory": "build"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: charts Changes related to the charts. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@mui/x-charts-vendor 9.11.0 is empty

3 participants