question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'skip' of undefined

See original GitHub issue

I am using chartjs for my React Application. The data is getting updated every second. If i give redraw as true then the Line chart redraws every second and it is not very pleasing, but if i give redraw as false, then the chart doesn’t update for some time and then it give the above TypeError. Below is the code that i am using.

getOptions(showLabelX, showLabelY) {
    return {
      responsive: true,
      maintainAspectRatio: false,
      legend: {
        display: true,
        position: "right"
      },
      scales: {
        yAxes: [
          {
            scaleLabel: {
              display: true
            },
            ticks: {
              display: true,
              minRotation: 0
            }
          }
        ],
        xAxes: [
          {
            gridLines: {
              display: false
            },
            scaleLabel: {
              display: true
            },
            ticks: {
              autoSkip: true,
              maxTicksLimit: 4,
              display: true,
              minRotation: 0
            }
          }
        ]
      }
    };
  };

render(){
   const options = this.getOptions(this.state.showLabelX, this.state.showLabelY);
   const data = this.state.data;
   return(
        <Line redraw = {false} data={data} options={options} />
    )
} 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
reinisgcommented, Apr 8, 2020

Hello, I have pretty similar issue - ‘Uncaught (in promise) TypeError: Cannot read property ‘height’ of undefined’ My case is different, I’m using WordPress and creating custom Gutenberg block plugin in edit function all works fine, chart is drawing corretly, but when I want to output in save function (which will show in post frontend), i get that error. The error is targeting to this line> ChartComponent.prototype.render = function render() { var _props3 = this.props, height = _props3.height, width = _props3.width, id = _props3.id;

I try to setup height for chart, but it doesn’t resolve the issue. My entire code in plugin:

import "./style.scss"; import "./editor.scss"; import {Line} from "react-chartjs-2"; const { registerBlockType } = wp.blocks; const chartData = { labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], datasets: [ { label: 'My First dataset', fill: false, lineTension: 0.1, backgroundColor: 'rgba(75,192,192,0.4)', borderColor: 'rgba(75,192,192,1)', borderCapStyle: 'butt', borderDash: [], borderDashOffset: 0.0, borderJoinStyle: 'miter', pointBorderColor: 'rgba(75,192,192,1)', pointBackgroundColor: '#fff', pointBorderWidth: 1, pointHoverRadius: 5, pointHoverBackgroundColor: 'rgba(75,192,192,1)', pointHoverBorderColor: 'rgba(220,220,220,1)', pointHoverBorderWidth: 2, pointRadius: 1, pointHitRadius: 10, data: [65, 59, 80, 81, 56, 55, 40] } ] }; export default registerBlockType("gcb/customgraph", { title: "Custom chart", description: "Create custom chart", category: "common", icon: "chart-bar", supports: { html: true }, edit: props => { return ( <div> <Line data={chartData} width="600" height="250"/> </div> ); } save: props => { return ( <div> <Line data={data} width="600" height="250" /> </div> ); } });

Have any ideas? Regards, Reinis

0reactions
dangreencommented, Oct 26, 2021

@reinisg Hi. If your issue is still relevant, please create a new issue with an example of issue reproduction (repo, codesandbox, …).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'skip' of undefined - Stack Overflow
I am using react-apollo for graphql query. I want to show a single object for category so for that I need an id...
Read more >
Chartjs > 2.5.0: Cannot read property 'skip' of undefined when ...
With Chartjs 2.6.0 on hover the chart apperars the exception: Cannot read property 'skip' of undefined when hover the chart on hover chart ......
Read more >
JS error: Uncaught TypeError: Cannot read property 'skip' of ...
Uncaught TypeError : Cannot read property 'skip' of undefined(anonymous function) @ jquery.highchartTable-patched.js?nzwkhj:240e.extend.each
Read more >
Cannot read property 'skip' of undefined when hover the chart ...
Chartjs > 2.5.0: Cannot read property 'skip' of undefined when hover the chart on hover chart.
Read more >
How to Avoid the Infamous "Cannot read properties of ... - Bitovi
That error message is telling you the function is returning undefined implicitly, but its return type does not include undefined in it. Awesome!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found