Node-red electron packaging with asar true error

I am packaging node-red using electron-builder with asar setting true. It works fine except that at the start of application I get this error.

Uncaught Exception:
TypeError: Cannot read property 'forEach' of undefined
at C:\Users\XXXX\AppData\Local\Programs\XXXXXX_client\resources\app.asar\node_modules@node-red\registry\lib\library.js:31:19
at electron/js2c/asar.js:24:28
at processTicksAndRejections (internal/process/task_queues.js:82:9)

node-red version: 1.1.0
node v12.13.1
"electron": "^6.0.5",
"electron-builder": "^21.2.0",

Electron packager explicitly removes example files from source so you need to manually re-add them to the build. See https://github.com/dceejay/electron-node-red/commit/ad7b3d00fc067ec1e305f80e545a5bd3b029623a

After applying the changes for examples to be included, now it moved to different error but same start.
[Window Title]
Error

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
TypeError: Cannot read property 'forEach' of undefined
at C:\Users\Accellion\AppData\Local\Programs\accellion_automation_client\resources\app\node_modules@node-red\registry\lib\library.js:31:19
at FSReqCallback.oncomplete (fs.js:153:23)

How can I get complete stack trace and log rather than window showing in error? Any idea for that.

well there must be some more files you need to include.... All the library foreach is reporting is that it has been asked to load something that isn't there. I guess you could add some console.log to that library.js file to try to identify what exactly is undefined.

Issue resolved after updating to
electron: 10.1.3
electron-builder: 22.8.1

Thanks for the help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.