I have a docker container set up with jsreport running. Here is the content of my docker file FROM jsreport/jsreport:2.5.0
In my controller I have decorated the action with
[MiddlewareFilter(typeof(JsReportPipeline))]
attribute and added
this.HttpContext.JsReportFeature().DebugLogsToResponse().Recipe(Recipe.ChromePdf).OnAfterRender((r) => HttpContext.Response.Headers["Content-Disposition"] = $"attachment; filename=\"{this.Form}.pdf\"");
before returning the view.
This is not working for me. I have copied the logs from my docker container:
2020-04-13T13:27:33.821Z - info: Searching for available extensions in /app/,
2020-04-13T13:27:33.825Z - info: Extensions location cache not found, crawling directories,
2020-04-13T13:27:34.097Z - info: Found 35 extensions,
2020-04-13T13:27:34.299Z - info: Setting dedicated-process (process based) strategy for rendering. Please visit http://jsreport.net/learn/configuration for information how to get more performance.,
2020-04-13T13:27:34.308Z - info: Using extension authentication@2.4.2,
2020-04-13T13:27:34.334Z - info: Using extension cli@2.2.2,
2020-04-13T13:27:34.336Z - info: Using extension debug@2.1.3,
2020-04-13T13:27:34.339Z - info: Using extension express@2.6.0,
2020-04-13T13:27:34.419Z - info: Using extension freeze@2.0.0,
2020-04-13T13:27:34.421Z - info: Using extension handlebars@2.1.0,
2020-04-13T13:27:34.423Z - info: Using extension import-export@1.5.1,
2020-04-13T13:27:34.465Z - info: Using extension jsrender@2.1.1,
2020-04-13T13:27:34.466Z - info: Using extension tags@2.3.0,
2020-04-13T13:27:34.467Z - info: Using extension templates@2.3.2,
2020-04-13T13:27:34.473Z - info: Using extension authorization@2.2.6,
2020-04-13T13:27:34.475Z - info: Using extension base@2.0.2,
2020-04-13T13:27:34.477Z - info: Using extension browser-client@2.2.2,
2020-04-13T13:27:34.478Z - info: Using extension child-templates@1.3.1,
2020-04-13T13:27:34.480Z - info: Using extension chrome-pdf@1.7.1,
2020-04-13T13:27:34.527Z - info: Using extension data@2.2.0,
2020-04-13T13:27:34.528Z - info: Using extension docx@2.5.0,
2020-04-13T13:27:34.531Z - info: Using extension fs-store@2.7.2,
2020-04-13T13:27:34.628Z - info: Using extension licensing@2.2.1,
2020-04-13T13:27:34.630Z - info: Using extension pdf-utils@1.6.1,
2020-04-13T13:27:34.736Z - info: Using extension pptx@0.5.0,
2020-04-13T13:27:34.739Z - info: Using extension reports@2.2.1,
2020-04-13T13:27:34.741Z - info: Using extension static-pdf@0.3.1,
2020-04-13T13:27:34.743Z - info: Using extension studio@2.7.0,
2020-04-13T13:27:34.840Z - info: Using extension text@2.0.0,
2020-04-13T13:27:34.843Z - info: Using extension version-control@1.3.2,
2020-04-13T13:27:34.898Z - info: Using extension assets@1.5.2,
2020-04-13T13:27:34.908Z - info: Using extension html-to-xlsx@2.6.0,
2020-04-13T13:27:35.137Z - info: html-to-xlsx detected chrome as available html engine,
2020-04-13T13:27:35.137Z - info: Using extension scheduling@2.2.0,
2020-04-13T13:27:35.177Z - info: Using extension scripts@2.3.0,
2020-04-13T13:27:35.182Z - info: Using extension studio-theme-dark@0.3.0,
2020-04-13T13:27:35.183Z - info: Using extension xlsx@2.3.0,
2020-04-13T13:27:35.263Z - info: Using extension public-templates@2.1.0,
2020-04-13T13:27:35.264Z - info: Using extension resources@2.0.3,
2020-04-13T13:27:35.265Z - info: Using extension sample-template@2.5.1,
2020-04-13T13:27:35.266Z - info: Using general timeout for rendering (reportTimeout: 60000),
2020-04-13T13:27:35.267Z - info: Using fs provider for template store.,
2020-04-13T13:27:35.275Z - info: fs store is persisting using fs,
2020-04-13T13:27:35.277Z - info: fs store sync is disabled,
2020-04-13T13:27:35.278Z - info: fs store underlying changes synchronization with studio is disabled,
2020-04-13T13:27:35.284Z - info: fs store is loading data,
2020-04-13T13:27:35.296Z - info: fs store is initialized successfully,
2020-04-13T13:27:35.331Z - info: Creating default express app.,
2020-04-13T13:27:35.355Z - info: jsreport server successfully started on http port: 5488,
2020-04-13T13:27:35.357Z - info: Verifying license key free,
2020-04-13T13:27:35.368Z - info: Using free license,
2020-04-13T13:27:35.374Z - info: reporter initialized,
2020-04-13T14:37:39.508Z - info: Starting rendering request 1 (user: null),
2020-04-13T14:37:39.510Z - info: Rendering anonymous template { recipe: undefined, engine: undefined },
2020-04-13T14:37:39.513Z - error: Rendering request 1 finished with error in 6 ms,
2020-04-13T14:37:39.514Z - error: Error when processing render request 1 Cannot read property 'includes' of undefined,
logs:,
+0 Starting rendering request 1 (user: null),
+3 Rendering anonymous template { recipe: undefined, engine: undefined },
+3 Data item not defined for this template.,
+3 Resources not defined for this template.,
+6 Rendering request 1 finished with error in 6 ms TypeError: Cannot read property 'includes' of undefined,
at AsyncFunction.<anonymous> (/app/node_modules/jsreport-pdf-utils/lib/main.js:79:28),
at /app/node_modules/listener-collection/lib/listenerCollection.js:171:33,
at /app/node_modules/listener-collection/lib/listenerCollection.js:151:16,
at tryCatcher (/app/node_modules/listener-collection/node_modules/bluebird/js/release/util.js:16:23),
at Promise._settlePromiseFromHandler (/app/node_modules/listener-collection/node_modules/bluebird/js/release/promise.js:512:31),
at Promise._settlePromise (/app/node_modules/listener-collection/node_modules/bluebird/js/release/promise.js:569:18),
at Promise._settlePromise0 (/app/node_modules/listener-collection/node_modules/bluebird/js/release/promise.js:614:10),
at Promise._settlePromises (/app/node_modules/listener-collection/node_modules/bluebird/js/release/promise.js:693:18),
at Async._drainQueue (/app/node_modules/listener-collection/node_modules/bluebird/js/release/async.js:133:16),
at Async._drainQueues (/app/node_modules/listener-collection/node_modules/bluebird/js/release/async.js:143:10),
at Immediate.Async.drainQueues (/app/node_modules/listener-collection/node_modules/bluebird/js/release/async.js:17:14),
at processImmediate (internal/timers.js:456:21),
2020-04-13T14:37:39.515Z - error: Error during processing request at http://localhost:5488/api/report,
2020-04-13T15:56:22.743Z - info: Starting rendering request 2 (user: null),
2020-04-13T15:56:22.744Z - info: Rendering template { name: PDF, recipe: chrome-pdf, engine: handlebars, preview: true },
2020-04-13T15:56:23.256Z - info: Rendering request 2 finished in 512 ms,
2020-04-13T15:57:08.984Z - info: Starting rendering request 3 (user: null),
2020-04-13T15:57:08.985Z - info: Rendering template { name: PDF, recipe: chrome-pdf, engine: handlebars, preview: true },
2020-04-13T15:57:09.445Z - info: Rendering request 3 finished in 461 ms,```