Skip to content
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

Problem with the React peer dependency in the latest CRA template #48

Open
TomasHubelbauer opened this issue Apr 9, 2022 · 3 comments

Comments

@TomasHubelbauer
Copy link

Hi, I am attempting to evaluate this component in an application based on Create React App. The CRA template I have used is recent, and it uses React 18. It seems the React peer dependency of ibm-gantt-chart-react is hardcoded to 16.8.6:

https://github.com/IBM/gantt-chart/blob/master/packages/ibm-gantt-chart-react/package.json#L42

When trying to install the component using npm i ibm-gantt-chart-react, NPM throws this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.8.6" from [email protected]
npm ERR! node_modules/ibm-gantt-chart-react
npm ERR! ibm-gantt-chart-react@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or U
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

This error will likely happen to anyone using latest React, regardless of whether they are using CRA or not.

Using npm i ibm-gantt-chart-react --legacy-peer-deps works, because to my knowledge there are no breaking changes between 16.8.6 and 18.0.0 that would prevent this component from working.

I think you could solve this issue by not hardcoding a React version in the peer dependency, but instead making it a range that accepts anything between 16.8.6 and 18. See these links:

Hope this helps.

@PauliusVa
Copy link

When i start this project it also has this errors:
Failed to parse source map: 'webpack://ibm-gantt-chart/C:/Users/yotamberk/Desktop/workspace/vis/dist/vis.js' URL is not supported.

Any ideas how to fix it ?

@NatsGt
Copy link

NatsGt commented Jun 13, 2023

I am using React 18.2.0 and I am getting this recurrent error.

Cannot read properties of undefined (reading 'appendChild') GanttPanel.create https://s8yt6v.csb.app/node_modules/ibm-gantt-chart/dist/ibm-gantt-chart.js:18692:17 GanttPanel.setConfiguration https://s8yt6v.csb.app/node_modules/ibm-gantt-chart/dist/ibm-gantt-chart.js:18595:14

I can see that the component is getting rendered, but still getting this error. I had to downgrade to React 17 to make it work.

@EricWebsmith
Copy link

I am using React 18.2.0 and I am getting this recurrent error.

Cannot read properties of undefined (reading 'appendChild') GanttPanel.create https://s8yt6v.csb.app/node_modules/ibm-gantt-chart/dist/ibm-gantt-chart.js:18692:17 GanttPanel.setConfiguration https://s8yt6v.csb.app/node_modules/ibm-gantt-chart/dist/ibm-gantt-chart.js:18595:14

I can see that the component is getting rendered, but still getting this error. I had to downgrade to React 17 to make it work.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants