Update the pdf-utils dependencies of jsreport2.11.0 to solve the error "pdf-utils operations. A Name cannot be undefined"



  • Hi,
    this error occurs and has been already discussed on https://forum.jsreport.net/topic/2002/pdf-utils-with-custom-font-causes-undefined-name-error/6 but recently it has shown up again.

    We suspect it was related to the package dependencies, as the fix has been released in the jsreport-pdfjs with at least the 0.5.3, actually released at 0.5.4; currently, the linked to the jsreport-pdf-utils into the 1.11.0 with 0.5.2 and the previously 1.10.1 has the 0.5.1 on dependencies. In those cases we've still check the error

    In the latest tagged and released version of jsreport 2.11.0 (https://github.com/jsreport/jsreport/blob/2.11.0/package.json), there is a stricted dependencies to the 1.10.1 that cause some problem with the npm ci installation of packages, and the following tagged version (that fix the dependencies) is the 3.0.0 that we could not install yet on customers.

    Can you please release a new version of js2 (2.11.1) with the dependencies updated, with jsreport-pdf-utils at 1.11.1 that has the dependencies of jsreport-pdfjs of 0.5.4? Or at least give us a procedure to follow in order to solve eventually other dependencies problem?

    Thank you.



  • I've just updated the pdf utils, you can install it from the npm.

    npm i --save jsreport-pdf-utils@1.11.1
    


  • Thanks. Now, this jsreport-pdf-utils version correctly ping to 0.5.4, but the version of jsreport is still 2.11.0 that has the dependencies of bugged jsreport-pdf-utils 1.10.1.

    Is it possibile to release a new tag of jsreport project with the dependencies of new version of pdf-utils?

    I've tried your code, but in jsreport folder i've got the node modules of 1.10.1 related to jsreport, and in the jsreport-pdf-utils folder the right 1.11.1; the jsreport render still using the 1.10.1 with the 'broken' package directory.

    Alternatively, is there a way to force the jsreport render to use a particular package version?



  • You should have something like this in the package.json

    {
      "name": "jsreport-server",
      "main": "server.js",
      "scripts": {
        "start": "node server",
        "jsreport": "jsreport"
      },
      "jsreport": {
        "entryPoint": "server.js"
      },
      "dependencies": {
        "jsreport": "2.11.0",
        "jsreport-pdf-utils": "1.11.1"
      }
    }
    

    The npm install will resolve to have app/node_modules/jsreport-pdf-utils/package.json containing the version 1.11.1. You should see also the following line in the jsreport start log

    2021-09-27T10:48:23.587Z - info: Using extension pdf-utils@local:C:\work\temp\app3\node_modules\jsreport-pdf-utils:1.11.1
    

    In other words, when you install a different version of an extension, jsreport will automatically skip its default extension version and use the one you installed.



  • It works,
    thank you for your explaination!


Log in to reply
 

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