Home forums Using CanvasJS React example setup error

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22927

    I tried setting up the example from the page https://canvasjs.com/docs/charts/integration/react/
    I have my canvasjs.min.js and canvasjs.react.js in my /src/ folder and getting the following error:

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

    Any possible solutions?
    Thank you

    #22928

    Priyanka M S
    Member

    @juliandeange,

    Can you please share a sample project over google-drive or one-drive reproducing the issue you are facing, so that we can look into your code, understand the scenario better and help you out?

    __
    Priyanka M S
    Team CanvasJS

    #22943

    Here is my App.js in the src/

    I also have the canvasjs.react.js and canvasjs.min.js in the src/ folder

    #22954

    Priyanka M S
    Member

    @juliandeange,

    The code you have shared seems to be working fine. Please cross-check the paths you specify while importing the files. Kindly take a look at this sample project.

    __
    Priyanka M S
    Team CanvasJS

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

You must be logged in to reply to this topic.