You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I've been trying to integrate pino logger into my electron-forge project.
Due to the way pino is architected (logs are actually handled in a web-worker) I had to make some changes to the webpack config:
change the output.filename in webpack.main.config.ts to make pino files output separately from the rest of the bundle
Now, the interesting part is that in debug mode (npm run start) it works, I can successfully see pino-pretty logs in the console. But when I try to make a production build it fails with the mentioned webpack error.
I've been trying to figure out how to fix it, but no luck so far. I don't think the problem is with pino since the debug app works, has something to do with how forge-webpack does the bundling.
Any help would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
Hi Dragos,
I am trying to understand the error and find a way to seamlessly integrate pino into electron-forge project. Meanwhile I suggest a work around for logging could be electron-log.
Hi Dragos, I am trying to understand the error and find a way to seamlessly integrate pino into electron-forge project. Meanwhile I suggest a work around for logging could be electron-log.
Thanks for the reply. The main reason why I wanted to add pino is because of its dynamic transport support. So in dev I would use pino-pretty and in prod pino-lodgna. Since I could't get it working I just used @logdna/logger directly.
Would be nice to get pino working tho. I tried looking into this myself, but I don't have experience with webpack so I got stuck.
Pre-flight checklist
Electron Forge version
7.3.0
Electron version
29.1.0
Operating system
macOS 14.3.1 Sonoma
Last known working Electron Forge version
No response
Expected behavior
npm run make
should successfully create a production webpack bundle.Actual behavior
npm run make
crashes with the following error:Steps to reproduce
Clone this example project: https://github.com/beastx-ro/electron-pino-crash-sample
npm run make
Additional information
Hi! I've been trying to integrate pino logger into my electron-forge project.
Due to the way pino is architected (logs are actually handled in a web-worker) I had to make some changes to the webpack config:
output.filename
inwebpack.main.config.ts
to make pino files output separately from the rest of the bundleNow, the interesting part is that in debug mode (
npm run start
) it works, I can successfully see pino-pretty logs in the console. But when I try to make a production build it fails with the mentioned webpack error.I've been trying to figure out how to fix it, but no luck so far. I don't think the problem is with pino since the debug app works, has something to do with how forge-webpack does the bundling.
Any help would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: