Recipe text not found



  • On some installations I get the error "Recipe 'text' not found".
    Has there been a change in recent version that this recipe needs to be added explicitly?



  • No changes regarding this. It is still part of the default installation.
    Please share more details and boot output logs.



  • Below is a log of the program, loading the jsreport service and trying to run a report with the text recipe.
    I noticed following issues:

    • Before the update, 35 extensions were detected, now only 28.
    • Some extensions (including the text recipe) have been installed in the main node_modules folder of my project instead of the subdirectory if the jsreport package.

    <pre>
    c:\ScoreExpress>npm start

    ScoreExpress@1.0.0 start c:\ScoreExpress
    cross-env NODE_ENV=production node --max-old-space-size=4096 server/server.js

    jsreport store dir c:\ScoreExpress\server\services/../../data
    2020-02-10T14:25:47.030Z - info: Initializing jsreport@2.6.1 in production mode using configuration file: none
    2020-02-10T14:25:47.030Z - info: Searching for available extensions in c:\ScoreExpress\node_modules\jsreport
    2020-02-10T14:25:51.716Z - info: Extensions location cache contains up to date information, skipping crawling in c:\ScoreExpress\node_modules\jsreport
    2020-02-10T14:25:51.732Z - info: Found 28 extensions
    2020-02-10T14:25:53.075Z - debug: Writing extension locations cache to c:\ScoreExpress\node_modules\jsreport\temp\core\locations.json
    2020-02-10T14:25:53.075Z - debug: Discovered 28 extensions
    2020-02-10T14:25:53.154Z - info: Setting http-server strategy for rendering
    2020-02-10T14:25:53.700Z - info: Using extension handlebars@2.1.0
    2020-02-10T14:25:53.716Z - debug: Extension jsrender@2.1.1 is disabled, skipping
    2020-02-10T14:25:53.716Z - info: Using extension tags@2.3.0
    2020-02-10T14:25:53.716Z - info: Using extension templates@2.3.2
    2020-02-10T14:25:53.732Z - debug: Extension authentication@2.3.0 is disabled, skipping
    2020-02-10T14:25:53.732Z - debug: Extension cli@2.1.1 is disabled, skipping
    2020-02-10T14:25:53.732Z - info: Using extension import-export@1.4.0
    2020-02-10T14:25:53.857Z - info: Using extension debug@2.1.1
    2020-02-10T14:25:53.857Z - info: Using extension express@2.5.0
    2020-02-10T14:25:53.997Z - info: Using extension pdf-utils@1.5.2
    2020-02-10T14:25:54.216Z - info: Using extension fs-store@2.6.0
    2020-02-10T14:25:54.497Z - info: fs store underlying changes synchronization with studio is disabled
    2020-02-10T14:25:54.513Z - info: Using extension data@2.1.0
    2020-02-10T14:25:54.513Z - info: Using extension chrome-pdf@1.6.1
    2020-02-10T14:25:54.591Z - debug: Chrome strategy is dedicated-process
    2020-02-10T14:25:54.591Z - info: Using extension licensing@2.1.2
    2020-02-10T14:25:54.591Z - debug: Extension authorization@2.2.5 is disabled, skipping
    2020-02-10T14:25:54.591Z - debug: Extension version-control@1.3.2 is disabled, skipping
    2020-02-10T14:25:54.591Z - info: Using extension reports@2.2.0
    2020-02-10T14:25:54.606Z - info: Using extension child-templates@1.3.0
    2020-02-10T14:25:54.606Z - info: Using extension browser-client@2.2.1
    2020-02-10T14:25:54.622Z - debug: Extension studio@2.6.6 is disabled, skipping
    2020-02-10T14:25:54.622Z - debug: Extension html-to-xlsx@2.4.1 is disabled, skipping
    2020-02-10T14:25:54.622Z - debug: Extension scheduling@2.1.1 is disabled, skipping
    2020-02-10T14:25:54.622Z - info: Using extension scripts@2.2.1
    2020-02-10T14:25:54.622Z - info: Using extension assets@1.5.1
    2020-02-10T14:25:54.638Z - debug: Extension xlsx@2.2.1 is disabled, skipping
    2020-02-10T14:25:54.638Z - debug: Extension sample-template@2.4.0 is disabled, skipping
    2020-02-10T14:25:54.638Z - info: Using extension resources@2.0.3
    2020-02-10T14:25:54.653Z - debug: Extension public-templates@2.1.0 is disabled, skipping
    2020-02-10T14:25:54.653Z - info: Using fs provider for template store.
    2020-02-10T14:25:54.653Z - info: fs store is persisting using fs
    2020-02-10T14:25:54.653Z - info: fs store is synchronizing using fs
    2020-02-10T14:25:54.653Z - info: fs store is loading data
    2020-02-10T14:25:54.716Z - info: fs store is initialized successfully
    2020-02-10T14:25:54.731Z - info: Configuring routes for existing express app.
    2020-02-10T14:25:54.747Z - info: Mounting routes under appPath (/reporting).
    2020-02-10T14:25:54.747Z - info: Using existing server instance.
    2020-02-10T14:25:54.747Z - debug: fs store sync modifications is disabled
    2020-02-10T14:25:54.747Z - info: Verifying license key free
    2020-02-10T14:25:54.747Z - info: Using free license
    2020-02-10T14:25:54.747Z - info: reporter initialized
    live score add { eventDisciplineId: '9e49053304a230b3e56e2222e0ff093a',
    type: 'eventDiscipline',
    subType: 'live' }
    check session 61719d702944fcca800f82787902589a finished
    public ranking 0 AA null
    check session 61719d702944fcca800f82787902589a finished
    public ranking 0 AA null
    check session 61719d702944fcca800f82787902589a finished
    public ranking 0 AA null
    public ranking 0 TEAM-AA null
    public ranking 0 TEAM-AA null
    public ranking 0 TEAM-AA null
    check session 61719d702944fcca800f8278790285b8 finished
    public ranking 0 AA null
    check session 61719d702944fcca800f827879027211 finished
    public ranking 0 AA null
    public ranking 0 TEAM-AA null
    public ranking 0 TEAM-AA null
    2020-02-10T14:26:34.298Z - info: Starting rendering request 1 (user: null)
    2020-02-10T14:26:34.302Z - info: Starting rendering request 2 (user: null)
    2020-02-10T14:26:34.306Z - info: Starting rendering request 3 (user: null)
    2020-02-10T14:26:34.314Z - info: Starting rendering request 4 (user: null)
    2020-02-10T14:26:34.318Z - info: Starting rendering request 5 (user: null)
    2020-02-10T14:26:34.322Z - info: Rendering template { name: xml, recipe: text, engine: handlebars, preview: false }
    2020-02-10T14:26:34.330Z - info: Rendering template { name: xml, recipe: text, engine: handlebars, preview: false }
    2020-02-10T14:26:34.334Z - info: Rendering template { name: xml, recipe: text, engine: handlebars, preview: false }
    2020-02-10T14:26:34.334Z - info: Rendering template { name: xml, recipe: text, engine: handlebars, preview: false }
    2020-02-10T14:26:34.338Z - info: Rendering template { name: xml, recipe: text, engine: handlebars, preview: false }
    2020-02-10T14:26:34.342Z - debug: Inline data specified.
    2020-02-10T14:26:34.346Z - debug: Resources not defined for this template.
    2020-02-10T14:26:34.350Z - debug: Inline data specified.
    2020-02-10T14:26:34.350Z - debug: Resources not defined for this template.
    2020-02-10T14:26:34.354Z - debug: Inline data specified.
    2020-02-10T14:26:34.354Z - debug: Resources not defined for this template.
    2020-02-10T14:26:34.358Z - debug: Inline data specified.
    2020-02-10T14:26:34.366Z - debug: Resources not defined for this template.
    2020-02-10T14:26:34.366Z - debug: Inline data specified.
    2020-02-10T14:26:34.366Z - debug: Resources not defined for this template.
    2020-02-10T14:26:34.382Z - debug: Rendering engine handlebars
    2020-02-10T14:26:34.398Z - debug: Rendering engine handlebars
    2020-02-10T14:26:34.402Z - debug: Rendering engine handlebars
    2020-02-10T14:26:34.406Z - debug: Rendering engine handlebars
    2020-02-10T14:26:34.422Z - debug: Rendering engine handlebars
    2020-02-10T14:26:34.606Z - debug: Compiled template not found in the cache, compiling
    2020-02-10T14:26:34.610Z - warn: Error when processing render request Recipe 'text' not found. If this is a custom recipe make sure it's properly installed from npm. Error: Recipe 'text' not found. If this is a custom recipe make sure it's properly installed from npm.
    at module.exports (c:\ScoreExpress\node_modules\jsreport\node_modules\jsreport-core\lib\util\createError.js:11:13)
    at Reporter.createError (c:\ScoreExpress\node_modules\jsreport\node_modules\jsreport-core\lib\reporter.js:299:12)
    at invokeRender (c:\ScoreExpress\node_modules\jsreport\node_modules\jsreport-core\lib\render\render.js:90:20)
    at <anonymous>
    2020-02-10T14:26:34.614Z - warn: Error during processing request at http://localhost:8080/reporting/api/report
    2020-02-10T14:26:34.618Z - debug: Compiled template not found in the cache, compiling
    Caught exception: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object
    TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object
    at Function.from (buffer.js:226:9)
    at new Buffer (buffer.js:174:17)
    at Request.init (c:\ScoreExpress\node_modules\request\request.js:319:21)
    at new Request (c:\ScoreExpress\node_modules\request\request.js:105:8)
    at request (c:\ScoreExpress\node_modules\request\index.js:53:11)
    at Request.request [as _callback] (c:\ScoreExpress\common\models\event\eventDiscipline.js:768:7)
    at Request.self.callback (c:\ScoreExpress\node_modules\request\request.js:129:22)
    at Request.emit (events.js:159:13)
    at Request.<anonymous> (c:\ScoreExpress\node_modules\request\request.js:873:14)
    at Request.emit (events.js:164:20)
    at IncomingMessage.<anonymous> (c:\ScoreExpress\node_modules\request\request.js:824:12)
    at IncomingMessage.emit (events.js:164:20)
    at endReadableNT (_stream_readable.js:1062:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)
    2020-02-10T14:26:34.654Z - debug: Taking compiled template from engine cache
    2020-02-10T14:26:34.658Z - debug: Taking compiled template from engine cache
    2020-02-10T14:26:34.662Z - debug: Taking compiled template from engine cache
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! ScoreExpress@1.0.0 start: cross-env NODE_ENV=production node --max-old-space-size=4096 server/server.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the ScoreExpress@1.0.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\gebruiker\AppData\Roaming\npm-cache_logs\2020-02-10T14_26_34_736Z-debug.log</pre>



  • So it seems that updating to the last version of my project (and thus updating some packages), the search location for detecting jsreport extensions changed from the main node_modules to the subdirectory of the jsreport package.
    When I add the rootDirectory option to my config and point it to the main node_modules directory it loads all extensions as before.



  • Hm strange. Don't you use a custom jsreport loader? I see you start jsreport from a nested dir server/server.js. I would need full description of your environment and how you install and start jsreport and understand what is going on.

    We calculate the rootDirectory as two dir levels up from jsreport folder.


Log in to reply
 

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