Error while building an application that includes jsreport



  • Hi Team,

    I had developed an application with the help of electron and jsreport. I can able to run the script directly but when it comes to build I am getting the error. If I add jsreport in dependencies, I am getting the following error while building the application itself:
    Error: Unresolved node modules: react
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\packageDependencies.ts:112:21
    at Generator.next (<anonymous>)
    From previous event:
    at Collector.resolveUnresolvedHoisted (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\packageDependencies.ts:88:81)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\packageDependencies.ts:83:18
    at Generator.next (<anonymous>)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)
    From previous event:
    at Collector.collect (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\packageDependencies.ts:76:28)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\packageDependencies.ts:47:44
    at Generator.next (<anonymous>)
    From previous event:
    at getProductionDependencies (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\out\util\packageDependencies.js:130:17)
    at Lazy.<anonymous> (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:109:24)
    at Generator.next (<anonymous>)
    From previous event:
    at Lazy.get value [as value] (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\lazy-val\src\main.ts:18:23)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\yarn.ts:121:81
    at Generator.next (<anonymous>)
    From previous event:
    at rebuild (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\out\util\yarn.js:234:18)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\yarn.ts:20:11
    at Generator.next (<anonymous>)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)
    From previous event:
    at installOrRebuild (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\out\util\yarn.js:68:17)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:451:13
    at Generator.next (<anonymous>)
    From previous event:
    at Packager.installAppDependencies (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:415:70)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:365:20
    at Generator.next (<anonymous>)
    From previous event:
    at Packager.doBuild (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:341:39)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:317:52
    at Generator.next (<anonymous>)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\graceful-fs\graceful-fs.js:99:16
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\graceful-fs\graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
    From previous event:
    at Packager._build (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:294:133)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:290:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)
    From previous event:
    at Packager.build (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\packager.ts:248:14)
    at C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\index.ts:51:40
    at Generator.next (<anonymous>)
    From previous event:
    at build (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\out\index.js:220:17)
    at build (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\src\builder.ts:234:10)
    at then (C:\Users\balasubramani\AppData\Roaming\npm\node_modules\electron-builder\src\cli\cli.ts:46:19)
    at <anonymous>

    so I tried to add the jsreport to devdependency, here the build runs successfully but while opening the application I am getting the following error:

    0_1528359872652_Error.PNG

    can anyone please help me to fix it.

    Thanks,
    Bala


  • administrators

    hi! packaging jsreport into electron is a complex topic, i never tried before but most issues will be about module resolution i guess (as you are seeing already). is it possible that you can show some demo project (jsreport + electron) that we can check? in these cases trying live on local computer is the best to better know what can be the issue or to confirm if it is possible to package jsreport into electron.



  • Hi,

    I have created a demo app using electron and jsreport and added to my github repository. Please check and update me.

    Github link: https://github.com/bala10/electron-jsreport



  • I tried putting the jsreport in dependencies and installed react so that the app gets builds and install fine but while opening the application it's not getting opened.

    Even I checked with electron team, they said everything from their side is fine. So can you people please check from your end what is the issue and help me out!


  • administrators

    sorry for the delay, let's continue conversation here


Log in to reply
 

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