IndexOf is not a function



  • When I build the dockerfile for jsreport and run the image I get the following error:

    2018-05-09T09:35:00.744Z - error: Error occured during reporter init TypeError: self.reporter.options.extensions.indexOf is not a function
    jsreport_1  |     at /usr/src/app/node_modules/jsreport-core/lib/extensions/extensionsManager.js:60:49
    jsreport_1  |     at Array.filter (<anonymous>)
    jsreport_1  |     at /usr/src/app/node_modules/jsreport-core/lib/extensions/extensionsManager.js:59:59
    jsreport_1  |     at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)
    jsreport_1  |     at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:512:31)
    jsreport_1  |     at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)
    jsreport_1  |     at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)
    jsreport_1  |     at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)
    jsreport_1  |     at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)
    jsreport_1  |     at Promise._resolveCallback (/usr/src/app/node_modules/bluebird/js/release/promise.js:432:57)
    jsreport_1  |     at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:524:17)
    jsreport_1  |     at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)
    jsreport_1  |     at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)
    jsreport_1  |     at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)
    jsreport_1  |     at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)
    jsreport_1  |     at Promise._resolveCallback (/usr/src/app/node_modules/bluebird/js/release/promise.js:432:57)
    jsreport_1  |     at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:524:17)
    jsreport_1  |     at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)
    jsreport_1  |     at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)
    jsreport_1  |     at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)
    jsreport_1  |     at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)
    jsreport_1  |     at /usr/src/app/node_modules/bluebird/js/release/nodeback.js:42:21
    jsreport_1  | TypeError: self.reporter.options.extensions.indexOf is not a function
    jsreport_1  |     at /usr/src/app/node_modules/jsreport-core/lib/extensions/extensionsManager.js:60:49
    jsreport_1  |     at Array.filter (<anonymous>)
    jsreport_1  |     at /usr/src/app/node_modules/jsreport-core/lib/extensions/extensionsManager.js:59:59
    jsreport_1  |     at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)
    jsreport_1  |     at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:512:31)
    jsreport_1  |     at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)
    jsreport_1  |     at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)
    jsreport_1  |     at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)
    jsreport_1  |     at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)
    jsreport_1  |     at Promise._resolveCallback (/usr/src/app/node_modules/bluebird/js/release/promise.js:432:57)
    jsreport_1  |     at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:524:17)
    jsreport_1  |     at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)
    jsreport_1  |     at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)
    jsreport_1  |     at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)
    jsreport_1  |     at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)
    jsreport_1  |     at Promise._resolveCallback (/usr/src/app/node_modules/bluebird/js/release/promise.js:432:57)
    jsreport_1  |     at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:524:17)
    jsreport_1  |     at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)
    jsreport_1  |     at Promise._settlePromise0 (/usr/src/app/node_modules/bluebird/js/release/promise.js:614:10)
    jsreport_1  |     at Promise._settlePromises (/usr/src/app/node_modules/bluebird/js/release/promise.js:693:18)
    jsreport_1  |     at Promise._fulfill (/usr/src/app/node_modules/bluebird/js/release/promise.js:638:18)
    jsreport_1  |     at /usr/src/app/node_modules/bluebird/js/release/nodeback.js:42:21
    


  • That was using 1.10



  • Actually I also get this error with 1.8.2 and 1.9



  • It seems that jsreport get in options extensions property with invalid type.
    Can you share more details what you run?



  • OK I see, I think I had created bad environment variables starting with extensions.

    Now this problem is gone but I get the following errors:

    2018-05-09T13:11:23.315Z - error: Error when loading extension TypeError: Cannot read property 'provider' of undefined
    jsreport_1  | TypeError: Cannot read property 'provider' of undefined
    jsreport_1  |     at module.exports (/usr/src/app/node_modules/jsreport-mongodb-store/lib/main.js:4:30)
    jsreport_1  |     at /usr/src/app/node_modules/jsreport-core/lib/extensions/extensionsManager.js:122:72
    jsreport_1  |     at tryCatcher (/usr/src/app/node_modules/bluebird/js/release/util.js:16:23)
    jsreport_1  |     at Promise._settlePromiseFromHandler (/usr/src/app/node_modules/bluebird/js/release/promise.js:512:31)
    jsreport_1  |     at Promise._settlePromise (/usr/src/app/node_modules/bluebird/js/release/promise.js:569:18)
    jsreport_1  |     at Promise._settlePromiseCtx (/usr/src/app/node_modules/bluebird/js/release/promise.js:606:10)
    jsreport_1  |     at Async._drainQueue (/usr/src/app/node_modules/bluebird/js/release/async.js:138:12)
    jsreport_1  |     at Async._drainQueues (/usr/src/app/node_modules/bluebird/js/release/async.js:143:10)
    jsreport_1  |     at Immediate.Async.drainQueues [as _onImmediate] (/usr/src/app/node_modules/bluebird/js/release/async.js:17:14)
    jsreport_1  |     at runCallback (timers.js:794:20)
    jsreport_1  |     at tryOnImmediate (timers.js:752:5)
    jsreport_1  |     at processImmediate [as _immediateCallback] (timers.js:729:5)
    

    and then

    Error occured during reporter init Error: Unsupported store provider mongodb
    jsreport_1  |     at module.exports.DocumentStore.init (/usr/src/app/node_modules/jsreport-core/lib/store/documentStore.js:37:11)
    

    This is by running a simple docker compose file:

    version: '3'
    services:
      mongo:
        image: mongo:3.4
        ports:
          - "27017:27017"
      jsreport:
        build: .
        ports:
          - "8080:5488"
        environment:
          connectionString_name: mongodb
          connectionString_uri: "mongodb://mongo"
          scripts_allowedModules: "*"
          tasks_allowedModules: "*"
        depends_on:
          - mongo
    

    with the docker file provided in your git repo, with the only one modification to change the version of jsreport to 1.8.2 (it fails with a different error on the latest)



  • Please install jsreport-mongodb-store@0.5.6 instead of 1.0.0
    We are at this moment in the middle of releasing new jsreport version and the latest jsreport-mongodb-store is not compatible with the current jsreport.



  • It's working thanks



  • Do you have an estimate on when version 2 will be released?



  • Two weeks ago :).
    We are working on it, please be patient.



  • ok we will be :)


Log in to reply
 

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