Cannot read properties of undefined (reading 'objectMode')



  • migrated an old instance from 2.1.1 to 3.6.2
    exported templates/scripts before upgrade, created new config and data directory, and imported/validated
    everything looks like it worked okay, but attempting to run any of the templates now gives the following error:

    Report render failed: Cannot read properties of undefined (reading 'objectMode') TypeError: Cannot read properties of undefined (reading 'objectMode')
        at Message.Writable.write (C:\Users\jsreport\apjsr\node_modules\readable-stream\lib\_stream_writable.js:292:22)
        at Message.Writable.end (C:\Users\jsreport\apjsr\node_modules\readable-stream\lib\_stream_writable.js:563:51)
        at MessageIO.sendMessage (C:\Users\jsreport\apjsr\node_modules\tedious\lib\message-io.js:131:13)
        at Connection.sendPreLogin (C:\Users\jsreport\apjsr\node_modules\tedious\lib\connection.js:1336:20)
        at Connection.socketConnect (C:\Users\jsreport\apjsr\node_modules\tedious\lib\connection.js:1960:14)
        at Connection.dispatchEvent (C:\Users\jsreport\apjsr\node_modules\tedious\lib\connection.js:1279:15)
        at Connection.socketConnect (C:\Users\jsreport\apjsr\node_modules\tedious\lib\connection.js:1303:10)
        at C:\Users\jsreport\apjsr\node_modules\tedious\lib\connection.js:1145:12
        at Socket.onConnect (C:\Users\jsreport\apjsr\node_modules\tedious\lib\connector.js:106:7)
        at Socket.emit (node:events:390:28) rootId=9d9r5dz7ql0akin, id=9d9r5dz7ql0akin
    

    any pointers on things I should look to address to resolve this (all the templates use scripts for data)



  • Do you script to fetch data from the mssql database?
    This error seems to come from the package that is typically used to connect to the mssql.



  • yes, this is fetching MSSQL - is it something I can upgrade in the Node/ODBC environment, or is it internal (fwiw running this as the standalone Windows service install)

    const sql = require('mssql');
    var config = {
        "user": "????",
        "password": "????",
        "server": "sql-????.database.windows.net",
        "encrypt": true,
        "database": "????_DevTest"
    }
    


  • Try to run it outside jsreport with the same nodejs version.
    This doesn't need to be releated to jsreport.



  • uninstalled the Node (and node_modules) and reinstalled Node and npm, did fresh npm install mssql and error seems to have gone away :)


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.