-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[charts] Issue with imports in DrawingProvider #10178
Comments
Looks like I fixed it with https://www.npmjs.com/package/@originjs/vite-plugin-commonjs. |
So related to #9826. |
Both this issue and #9826 should be fixed by #10272. The problem of this issue and #9826 is not that we're not providing a commonjs export. It's that we were declaring in the charts that we have a commonjs export while in reality it didn't work. It didn't work because there is no commonjs version of d3. (And we didn't build a workaround for that limitation yet as we want to spend our time building features first and take this opportunity to probe the community to see how big of a problem it would be to just not build that workaround ever) Since module resolution amongst bundlers and custom setups these days is basically the wild west, some of them get totally confused. #10272 removes that faulty export so that modern enough bundlers don't get confused. I believe we can close these issues until the community makes a convincing case for us to add a non-broken commonjs version. i.e. Where being on a non-standard setup is justified. While there will be commonjs around for a very long time, the ratio commonjs/ESM will only decrease going forward. (cc @alexfauquette Would it make sense to create a specific label for issues related to the charts ESM setup? It'd make it easier for me to keep tabs on them) |
Created |
Duplicates
Latest version
Steps to reproduce 🕹
Steps:
tools-public
app in https://github.com/mui/mui-public"@mui/toolpad": "^0.1.24"
in package.json to"https://pkg.csb.dev/mui/mui-toolpad/commit/e9b0fb8d/@mui/toolpad"
- the version from the PR in Migrate Chart component to X charts library toolpad#2500, which implements MUI X charts for the first timeyarn dev
Current behavior 😯
The app does not load, with the following console error:
Expected behavior 🤔
The app should load with no errors.
Context 🔦
Hopefully this information is helpful in identifying that the issue might be. I guess that it might be an issue with ESM imports like we have had before.
Otherwise let me know and I can try to help in anything that's needed!
That version of Toolpad is using the latest version of the MUI X charts, which should already include the latest fixes for imports, and has the following imports:
Will try to confirm as much as possible that this isn't a Toolpad issue just to be sure, sorry if it ends up being that!
Your environment 🌎
Mac, Google Chrome
The text was updated successfully, but these errors were encountered: