Not unique PreloadScriptRegistration id causes error

#475 · closed · 1 comments

View on GitHub ↗

pussbb

https://github.com/megahertz/electron-log/blob/c9dd519dbda11c44ab3031b36e758fdd479be367/src/main/ElectronExternalApi.js#L170 causes ```plain Error: Cannot register preload script with existing ID 'electron-log-preload' at setPreload (/opt/cogia/cnxdesktop_v2/node_modules/electron-log/src/main/ElectronExternalApi.js:168:17) at ElectronExternalApi.setPreloadFileForSessions (/opt/cogia/cnxdesktop_v2/node_modules/electron-log/src/main/ElectronExternalApi.js:154:7) at initializePreload (/opt/cogia/cnxdesktop_v2/node_modules/electron-log/src/main/initialize.js:72:15) at App.<anonymous> (/opt/cogia/cnxdesktop_v2/node_modules/electron-log/src/main/initialize.js:20:11) at Object.onceWrapper (node:events:633:26) at App.emit (node:events:530:35) ``` According to the documantaion https://www.electronjs.org/docs/latest/api/structures/preload-script-registration > id string (optional) - Unique ID of preload script. Defaults to a random UUID.

Comments

megahertz

Thanks. It looks like the initialize function has been called twice. Now it shows a warning for this case.