TypeError: Cannot read properties of null (reading 'getLabelAndValue') | TypeError: controller is null
Expected behavior
component renders normally
Current behavior
i have a barplot that is clickable to reveal a barplot below (based on where you clicked on the initial barplot). most of the time this works fine, however sometimes (and its not always..) i get the following error:
next-dev.js?3515:24 The above error occurred in the <ForwardRef(ChartComponent)> component:
at ChartComponent (webpack-internal:///./node_modules/react-chartjs-2/dist/index.js:96:11)
at Charts (webpack-internal:///./components/Charts.tsx:297:22)
at div
at div
at div
at ChartComponent (webpack-internal:///./components/ChartComponent.tsx:273:22)
at div
at div
at Result (webpack-internal:///./pages/[results]/index.tsx:59:72)
at MyApp (webpack-internal:///./pages/_app.tsx:11:27)
at ErrorBoundary (webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:8:20740)
at ReactDevOverlay (webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:8:23547)
at Container (webpack-internal:///./node_modules/next/dist/client/index.js:152:9)
at AppContainer (webpack-internal:///./node_modules/next/dist/client/index.js:655:26)
at Root (webpack-internal:///./node_modules/next/dist/client/index.js:777:27)
React will try to recreate this component tree from scratch using the error boundary you provided,
on firefox the error is:

Reproducible sample
sorry i cant share the code
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
3.9.1
Browser name and version
No response
Link to your project
No response
it seems to mainly happen when there is a lot of information on the plot. either way, is there a way for the component to fail "gracefully" rather than messing up the entire site?
Without a reproducible sample we can't help you so please add one since it is a required field in the issue template
Closing since it is not reproducible, if a reproducible sample becomes available feel free to re-open the issue again
I am facing the same error. Does anyone has the solution for the same. It is happening for the pie chart only.
@faraz-ahmad-uft can you provide any additional information? Do you have the error from your console?