Skip to content

TypeError when rendering a Pie chart #118

@frederikcreemers

Description

@frederikcreemers

I'm getting the following error:

Chart.js:30 Uncaught TypeError: Cannot read property 'offsetWidth' of undefined
    at computeDimension (Chart.js:30)
    at new Chart (Chart.js:40)
    at ChartComponent.renderChart (index.js:227)
    at ChartComponent.componentDidMount (index.js:77)
    at ReactCompositeComponent.js:265
    at measureLifeCyclePerf (ReactCompositeComponent.js:75)
    at ReactCompositeComponent.js:264
    at CallbackQueue.notifyAll (CallbackQueue.js:76)
    at ReactReconcileTransaction.close (ReactReconcileTransaction.js:80)
    at ReactReconcileTransaction.closeAll (Transaction.js:206)

Looking through the functions referenced in the stack trace, it looks like the canvas element couldn't be found in the dom.

I'm using the chart exactly as in the examples, and I have no idea what might be different between my app and the examples app that might be causing this difference. Could the way webpack bundles things cause issues?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions