Skip to content

Build Error with mui/x-charts #10265

@Cav19

Description

@Cav19

🐛 bug report

I recently installed the @mui/x-charts library as a new dependency in my project. I am able to successfully build and run the project within my local Docker container when running npm start (node_modules/.bin/parcel index.html) but when I attempt to run npm run build (node_modules/.bin/parcel build index.html`) in my GitHub Actions environment or even locally, the build fails with the following error message:

Error: The expression evaluated to a falsy value:

  (0, _assert().default)(internalBundleGraph != null)

I've been able to confirm that this is some problem with the way that parcel is working with the MaterialUI charting library by commenting out the specific chart imports and then validating that the build completes successfully.

🎛 Configuration (.babelrc, package.json, cli command)

{
  "private": true,
  "scripts": {
    "start": "node_modules/.bin/parcel index.html",
    "build": "node_modules/.bin/parcel build index.html",
    "lint": "eslint \"js/**/*.jsx\"",
    "lint:fix": "eslint \"js/**/*.jsx\" --fix"
  },
  "@parcel/resolver-default": {
    "packageExports": true
  },
  "type": "module",
  "dependencies": {
    "@emotion/react": "^11.9.0",
    "@emotion/styled": "^11.8.1",
    "@fontsource/roboto": "^4.5.3",
    "@mui/icons-material": "^6.5.0",
    "@mui/lab": "^6.0.0-beta.8",
    "@mui/material": "^6.5.0",
    "@mui/system": "^6.5.0",
    "@mui/x-charts": "^8.26.0",
    "@parcel/diagnostic": "^2.9.3",
    "@parcel/logger": "^2.9.3",
    "@popperjs/core": "^2.11.5",
    "@reduxjs/toolkit": "^1.7.1",
    "axios": "^1.12.0",
    "cross-env": "^7.0.3",
    "date-fns": "^2.27.0",
    "dotenv": "^16.0.1",
    "framer-motion": "^6.5.1",
    "laravel-echo": "^1.14.1",
    "linkify-react": "^4.3.2",
    "material-react-table": "^3.2.1",
    "os-browserify": "^0.3.0",
    "papaparse": "^5.5.3",
    "path-browserify": "^1.0.1",
    "popmotion": "^11.0.5",
    "process": "^0.11.10",
    "prop-types": "^15.7.2",
    "pusher-js": "^7.4.0",
    "react": "^18.2.0",
    "react-countup": "^6.1.1",
    "react-datepicker": "^4.5.0",
    "react-dom": "^18.2.0",
    "react-dom-confetti": "^0.2.0",
    "react-intersection-observer": "^9.8.1",
    "react-number-format": "^5.1.3",
    "react-redux": "^7.2.6",
    "react-responsive-carousel": "^3.2.23",
    "react-router": "^7.12.0",
    "react-select": "^5.2.1",
    "react-select-search": "^3.0.10",
    "react-to-print": "^2.14.2",
    "redux-thunk": "^2.4.1",
    "regenerator": "^0.14.7",
    "sass": "^1.44.0",
    "sass-loader": "^12.4.0",
    "use-react-router-breadcrumbs": "^4.0.1"
  },
  "devDependencies": {
    "@parcel/reporter-bundle-analyzer": "^2.10.3",
    "@parcel/transformer-sass": "^2.15.4",
    "buffer": "^6.0.3",
    "crypto-browserify": "^3.12.1",
    "eslint": "^8.57.0",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-jsx-a11y": "^6.9.0",
    "eslint-plugin-react": "^7.34.3",
    "jquery": "^3.6.0",
    "lodash": "^4.17.23",
    "parcel": "^2.16.3",
    "stream-browserify": "^3.0.0",
    "string_decoder": "^1.3.0",
    "svgo": "^3.3.2",
    "vm-browserify": "^1.1.2"
  }
}

🤔 Expected Behavior

Expected behavior is that the build completes successfully with the @mui/x-charts library install

😯 Current Behavior

Example MUI Chart import:

import { PieChart, LineChart } from '@mui/x-charts';

Full Stack Trace on Build Run:

Error: The expression evaluated to a falsy value:

  (0, _assert().default)(internalBundleGraph != null)


  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
  
    (0, _assert().default)(internalBundleGraph != null)
  
      at BundlerRunner.bundle 
  (src/node_modules/@parcel/core/lib/requests/BundleGraphRequest.js:311:29)
      at async Object.run 
  (src/node_modules/@parcel/core/lib/requests/BundleGraphRequest.js:123:17)
      at async RequestTracker.runRequest 
  (src/node_modules/@parcel/core/lib/RequestTracker.js:758:20)
      at async Object.run 
  (src/node_modules/@parcel/core/lib/requests/ParcelBuildRequest.js:52:7)
      at async RequestTracker.runRequest 
  (src/node_modules/@parcel/core/lib/RequestTracker.js:758:20)
      at async Parcel._build 
  (/src/node_modules/@parcel/core/lib/Parcel.js:320:11)
      at async Parcel.run 
  (src/node_modules/@parcel/core/lib/Parcel.js:210:18)
      at async run (src/node_modules/parcel/lib/cli.js:356:7)

🌍 Your Environment

Software Version(s)
Parcel 2.16.3
MUI Charts 8.26.0
Node 20
npm/Yarn 9.7.2
Operating System ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions