You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Linking charts creates an invariant error because we are using hooks with a different version of react.
We need to switch react and react-dom to peerDependencies and devDependencies. Preferably the same as in kibana to avoid unknown errors.
To Reproduce
Steps to reproduce the behavior:
run yarn link in charts and link in kibana. Notice the error in the console when viewing any elastic-chart.
Expected behavior
No errors
Versions:
OS: any
Browser: any
Elastic Charts: master
Errors in browser console
Uncaught Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
The above error occurred in the <Provider> component:
in Provider
in Chart (created by XYChart)
in XYChart (created by XYChartReportable)
in div (created by VisualizationContainer)
in VisualizationContainer (created by XYChartReportable)
in XYChartReportable
in PseudoLocaleWrapper (created by I18nProvider)
in IntlProvider (created by I18nProvider)
in I18nProvider
The text was updated successfully, but these errors were encountered:
Actually I think I still tried it with that and it was still an issue because EC will still use the EC/node_modules/react not KIBANA/node_modules/react.
The solution, per this SO article, was to use yarn link to link EC to kiabna and then run npm link <path_to_kibana>/node_modules/react in EC. Then it worked.
But now with the shared deps package it doesn't work at all so I just remove EC from the shared deps if I need to link it. Seems very complicated for such a simple task.
Describe the bug
Linking charts creates an invariant error because we are using hooks with a different version of
react
.We need to switch
react
andreact-dom
topeerDependencies
anddevDependencies
. Preferably the same as in kibana to avoid unknown errors.To Reproduce
Steps to reproduce the behavior:
run
yarn link
in charts and link in kibana. Notice the error in the console when viewing any elastic-chart.Expected behavior
No errors
Versions:
master
Errors in browser console
The text was updated successfully, but these errors were encountered: