Load SpreadJS using nodeJS

Posted by: asaurabh077 on 19 September 2018, 9:42 pm EST

    • Post Options:
    • Link

    Posted 19 September 2018, 9:42 pm EST

    I am trying to load SpreadJS using nodeJS and mock-browser on command prompt. I got [this][/How to Generate an Excel Spreadsheet from your Node.js Application | SpreadJS] but its giving me error (Please refer attached screen shot). You can find more details on my [stackoverflow][https://stackoverflow.com/questions/52399963/load-spreadjs-using-nodejs] question. Please let me know if you need more information or code. We are SpreaJS licencee.

    Your help will be highly appreciated.

    Saurabh Virtua Research

  • Posted 19 September 2018, 9:43 pm EST - Updated 29 September 2022, 5:02 am EST

  • Posted 26 September 2018, 11:09 pm EST


    You can download the sample application which seems to be working fine at my end. Please make sure to to add all the pre-requisites before running the application.

    Thanks, Deepak Sharma

  • Posted 26 September 2018, 11:28 pm EST

    Here is the attachment.

  • Posted 26 September 2018, 11:29 pm EST

  • Posted 27 September 2018, 5:12 pm EST

    Did you try the same on windows?? I think it does not work properly on windows as it has some issues with Canvas.

    And sadly in [spreadJS][/Download JavaScript Spreadsheet | SpreadJS] tutorial you have not mentioned anywhere we do need to install canvas/canvas-prebuilt.

  • Posted 1 October 2018, 12:53 am EST


    I tested the project on Windows machine only. Could you please let me know are you not able to run the project I sent in my last response? What error message are you getting related to ‘canvas-prebuilt’? Please provide me your application to test further for Windows OS.

    Thanks, Deepak Sharma

  • Posted 7 March 2019, 1:56 am EST

    hi I am running into a similar issue.

    TypeError: Cannot read property 'do' of undefined
        at ma.cq (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:29:11295)
        at xa.ow (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:34:14912)
        at xa.sw (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:34:16509)
        at xa.fromJSON (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js:41:15172)
        at exports.convert (/home/kpatel/tmail/TrunkB/server/services/njs/api/controllers/spreadJsController.js:40:8)
        at Layer.handle [as handle_request] (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/layer.js:95:5)
        at next (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/route.js:137:13)
        at Route.dispatch (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/route.js:112:3)
        at Layer.handle [as handle_request] (/home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/layer.js:95:5)
        at /home/kpatel/tmail/TrunkB/server/services/njs/node_modules/express/lib/router/index.js:281:22

    I tried downloading this zip you attached and when I run it on my Ubuntu18 box I get nothing after this line. I tried putting console.log after the fromJSON but nothing happens


    kpatel@kpatel-laptop:~/Desktop/SpreadSheetsNodeJSApp/SpreadSheetsNodeJSApp$ node app.js

    ** Using Spreadjs Version “^11.2.1” **

    Manipulating Spreadsheet

    To debug I added

    , function (e) {
        // process error

    to excelIO.open and now I am getting

    ** Using Spreadjs Version "11.2.1" **
    Manipulating Spreadsheet
    { errorCode: 1, errorMessage: 'Incorrect file format.' }
  • Posted 8 March 2019, 12:35 am EST


    Please make sure that all the referenced Spread.Sheets are loaded. Go through the steps mentioned in the blog here:

    Please let me know in case the issue still exists.

    Thanks, Deepak Sharma

  • Posted 24 April 2023, 7:19 pm EST

    • I am trying to use SpreadJs on nodejs server but I got the same error: “Cannot read properties of undefined (reading ‘do’)” on “workbook.fromJSON(“data”)” . There are have any solution for this?
  • Posted 25 April 2023, 3:03 am EST


    This could also be caused by setting invalid license keys, or not setting them properly. Following the blog Deepak shared above, please ensure you are setting valid license keys.

    You may also want to check any plugins/extensions you have installed for NodeJS, as there’s a chance they could be causing some interference. If this is the case, please feel free to share which have caused issues.



Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels