-
Notifications
You must be signed in to change notification settings - Fork 186
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
fix: exclude jsx-runtime from bundle #1928
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for carbon-charts-core ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-charts-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-charts-angular ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-charts-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I don't think |
This doesn't necessarily drop it, it just excludes it from the bundle. Then instead of the 3rd party package being bundled, it is required at the top of the bundle. This way the version used matches the version installed by the user which changes between React 18 and 19 It's the same reason you are already excluding react and react-dom. You want the code to use the installed version and not an explicit version |
Are you having these issues with the UMD bundle? or with the ESM? |
I'm using NextJs, so it's using the ESM bundle, but it would also be a problem when using the UMD bundle. Although not officially supported yet by this library, if you try to use the library with React 19, you'll see the issue. If you try to search the bundles for React dependencies should be peer dependencies and not bundled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theiliad any update here? This seems logical to require peer deps and this is stopping successful migration to React 19. I confirmed no issue with React 19 and the main Carbon library. The issue is only with the charts package.
TypeError: Cannot read properties of undefined (reading 'ReactCurrentDispatcher')
1 | import React from 'react';
> 3 | import {GaugeChart} from '@carbon/charts-react';
Updates
Exclude react/jsx-runtime from the final bundle. This should be excluded to allow users to update to React v19.
Including this dependency in the bundle results in
"TypeError: Cannot read properties of undefined (reading 'ReactCurrentDispatcher')"
fixes #1927