Home forums Using CanvasJS module.exports error with reactJS

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Priyanka M S 1 month ago.

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

    gautamtata
    Member

    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

    gautamtata
    Member

    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

    Priyanka M S
    Member

    @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.