Repository navigation
[charts] Fix empty @mui/x-charts-vendor published package - #23310
Merged
Merged
Conversation
`@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.
Deploy previewBundle size
PerformanceTotal duration: 1,713.05 ms +122.36 ms(+7.7%) | Renders: 63 (+0) | Paint: 2,288.14 ms +146.96 ms(+6.9%)
…and 7 more (+14 within noise) — details Metric alarms
Check out the code infra dashboard for more information about this PR. |
JCQuintas
enabled auto-merge (squash)
August 6, 2026 14:03
LukasTy
approved these changes
Aug 6, 2026
cherniavskii
reviewed
Aug 6, 2026
|
|
||
| // 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']; |
Member
There was a problem hiding this comment.
For what it's worth, this change isn't necessary.
Removing .npmrc is enough, since publish config already points to the build folder:
mui-x/packages/x-charts-vendor/package.json
Lines 53 to 56 in cad99f0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #23309
@mui/x-charts-vendor@9.11.0was published with onlypackage.jsonandREADME.md(2 files, 8 KB, versus 354 files at 9.4.0). Every vendored entry point is missing, so@mui/x-charts@9.11.0fails at runtime.Root cause
pnpm 11.13.0 (pnpm/pnpm#12878) made
pnpm packinherit ancestor ignore files when packing a workspace package. The repository crossed that version in #23177.x-charts-vendorsetspublishConfig.directory: "build", so the packlist root ispackages/x-charts-vendor/build. pnpm's guard that disables inheritance when a package declares its own.npmignorechecks the packlist root, andbuild/has none sincescripts/build.mjswipes and regenerates it. Sopackages/x-charts-vendor/.npmignoreis applied relative tobuild/instead of the package root:Only the files npm always force-includes survive, which is exactly
package.jsonandREADME.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
filesallowlist in the generatedbuild/package.json. It takes precedence over inherited ignore files (pnpm/pnpm#13231).packages/x-charts-vendor/.npmignore.publishConfig.directoryalready restricts what is packed, and no sibling package has one.Both changes are needed. Removing
.npmignorealone yields 330 files, because the root.gitignoreis then inherited and itsdist/rule silently drops the 24lib-vendor/*/distfiles that 9.4.0 shipped.Verification
Built and packed at tag
v9.11.0with pnpm 11.17.0:require('@mui/x-charts-vendor/d3-scale')andimportof the vendored entry points both resolve from the packed tarballFollow-up
@mui/x-charts-vendor@9.11.0cannot be overwritten on npm, so it needs a 9.11.1 republish.@mui/x-charts@9.11.0depends on^9.11.0, so fresh installs recover without a charts release. Deprecating 9.11.0 would stop new installs landing on it.