Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

TypeError: Cannot read properties of null (reading 'getLabelAndValue') | TypeError: controller is null

Open ccbiozhaw opened this issue 3 years ago • 2 comments

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:

image

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

ccbiozhaw avatar Nov 22 '22 15:11 ccbiozhaw

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?

ccbiozhaw avatar Nov 22 '22 15:11 ccbiozhaw

Without a reproducible sample we can't help you so please add one since it is a required field in the issue template

LeeLenaleee avatar Nov 22 '22 16:11 LeeLenaleee

Closing since it is not reproducible, if a reproducible sample becomes available feel free to re-open the issue again

LeeLenaleee avatar Apr 19 '23 23:04 LeeLenaleee

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 avatar May 07 '24 13:05 faraz-ahmad-uft

@faraz-ahmad-uft can you provide any additional information? Do you have the error from your console?

DAcodedBEAT avatar May 07 '24 22:05 DAcodedBEAT