Home Forums Chart Support module.exports error with reactJS

module.exports error with reactJS

Viewing 3 posts - 1 through 3 (of 3 total)
  • #23413

    TypeError: Cannot assign to read only property ‘exports’ of object ‘#<Object>’
    Module.<anonymous>
    src/Components/canvasjs.react.js:42
    39 | }
    40 | }
    41 |
    > 42 | module.exports = {
    43 | CanvasJSChart: CanvasJSChart,
    44 | CanvasJS: CanvasJS
    45 | };

    I get the above error when I try to render the above. Just a simple chart there are no ES6/ES5 errors on the canvasjs.react.js file. It’s the exact same one I downloaded. Can someone please help me out with the solution?

    Thanks!

    #23414

    Nevermind.The problem is mixing of ES5 and ES6 import exports (module.exports) is not allowed after webpack2. Deprecated the webpack version and works!

    #23416

    @gautamtata,

    Glad that you figured it:)

    __
    Priyanka M S
    Team CanvasJS

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.