asset encoded as dataURI needs to have file extension



  • I have migrated jsreport from v2 to v4. When I run the charts template, I am getting below error.

    Error when processing render request 2
    (because) asset encoded as dataURI needs to have file extension jpeg|jpg|gif|png|svg|woff|tff|otf|woff2|eot
    Error: Asset encoded as dataURI needs to have file extension jpeg|jpg|gif|png|svg|woff|tff|otf|woff2|eot
    at module.exports (/home/rohith/veracode/js-report/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)
    at WorkerReporter.createError (/home/rohith/veracode/js-report/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:49:12)
    at convert (/home/rohith/veracode/js-report/node_modules/@jsreport/jsreport-assets/lib/worker.js:53:24)
    at /home/rohith/veracode/js-report/node_modules/async-replace-with-limit/async-replace.js:73:26

    Here is the code which was used in v2 working fine:

    var logoElement = document.createElement('img');
    logoElement.setAttribute('class', 'col-sm logo');
    logoElement.setAttribute('src', '{#asset {{logo}} @encoding=dataURI}');



  • What the {{logo}} resolves to?

    Please share the failing workspace in the playground.
    https://playground.jsreport.net/



  • The issue was with the data migration. I created new data source for template and it works fine.


Log in to reply
 

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