How to get full log of packaged electron app error?

Viewed 339

enter image description here

How can i know what node module is causing my packaged app to crash?the path is cut short. Is there a way to get this error to terminal or file?

UPDATE: i know the error comes from importing my workspace with yarn workspaces, i commented this and packaged the app and works but i dont know whats wrong.it works when i just build it and run from terminal.

const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
const { format } = require('url');
const { organizeFiles } = require('@movepics/script'); THIS ONE

let mainWindow;

function createWindow() {...
2 Answers

Since you don't have a console to display on in a production environment, you need to output the logs to a log file instead of a console. And then you can have an "upload logs" option (or just view it, if it's on your device not on a customer's device).

To do this use the "electron-log" npm package.

const log = require('electron-log');
 
log.info('Hello, log');
log.warn('Some problem appears');

Caveat: Make sure you comply with the law regarding logs, as, mostly, logs have to be uploaded anonymously

So i was messing around with what i discovered and it seems cuz i have a exe file inside my package(yarn workspace) it causes this error, i just deleted the exe and now it works.

Conclusion i have to learn how to make a package with prebuilt binaries inside or make the installer of electron download the binary.

Related