Skip to content

CodeArtifact is unable to host @mui/icons-material 9.0.0

0

@mui/icons-material 9.0.0 has a very large package.json file, so large that it exceeds CodeArtifact's metadata size limit for the "NPM publish" endpoint.

Steps to reproduce:

  • create a CodeArtifact repository and connect it to NPM
  • validate it's working by installing some packages (express, lodash etc)
  • npm install @mui/icons-material@9.0.0

Result:

  • npm can't find the package
  • it never shows up in CodeArtifact, no matter how long you wait

Steps (part 2):

  • npm pack @mui/icons-material@9.0.0 --registry https://registry.npmjs.org
  • npm publish ./mui-icons-material-9.0.0.tgz --registry <CodeArtifact URL>

Result:

npm error 400 Bad Request - PUT https://<CodeArtifact URL> - 1 validation error detected: Value at 'versions.9.0.0.member.metadata' failed to satisfy constraint: Member must have length less than or equal to 1048576

versions.9.0.0 is the contents of package.json, it is 1367703 bytes long

I've reached out to the MUI team and they are unlikely to reduce the size of their package.json https://github.com/mui/material-ui/issues/48355

asked a month ago35 views
2 Answers
2

While the AI correctly identifies the metadata limit, you can try to bypass this issue with these two approaches:

Scoped Registry Bypass: Update your .npmrc to fetch MUI directly from the public registry while keeping CodeArtifact for everything else:

@mui:registry=https://registry.npmjs.org/

Manual "Slim" Patch:

  1. Run npm pack @mui/icons-material@9.0.0.

  2. Extract the tarball and manually prune the package.json (remove large description texts, devDependencies, or unnecessary fields).

  3. Repack and npm publish to CodeArtifact as a custom version (e.g., 9.0.0-slim).

This should allow you to keep using the version, even if AWS doesn't increase the hard metadata limit.

EXPERT
answered a month ago
0

Based on the error message you're receiving, this appears to be a limitation with CodeArtifact's npm publishing constraints. The maximum size for npm publishing requests to CodeArtifact is 2 GB total, which includes both the package metadata and the content of the npm package tar archive bundled together in the HTTP PUT request. However, there's also a constraint on the metadata portion specifically, which appears to be what you're encountering with the 1 MB (1,048,576 bytes) limit on the package.json metadata.

Since the @mui/icons-material 9.0.0 package.json is approximately 1.37 MB, it exceeds this metadata size constraint. This is separate from the asset file size maximum quota, which can be increased through a quota increase request, but the 2 GB npm publishing request limit and metadata constraints cannot be raised.

Unfortunately, if the MUI team is unable to reduce the size of their package.json file, this package version cannot be published directly to CodeArtifact due to these service constraints. You may need to consider alternative approaches, such as using an earlier version of the package with a smaller package.json, or exploring workarounds with the MUI team for how they structure their package metadata.
Sources
Packages overview - CodeArtifact

answered a month ago
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.