Closed lcorniglione closed 10 months ago
Thank you for the report. I'll try to find time later to add a CRA project to integration tests. Currently, you can try to configure babel to use ES2022 or newer preset. TBH, I have no idea why the bundler defines module.exports
as read only.
I created CRA 5.0.1, but it works fine out of box, so it's related to a local bundler config.
I'm not sure about the reason why __electronLog
is undefined. The injection of this variable to a renderer process is pretty tricky to pass isolation limitations, there's a chance it's related to the bundler too. Anyway, make sure you using the latest electron-log@beta.
A sample project which reproduces the error could be helpful to find the actual reason.
There's a chance the issue is fixed in 5.1.0. If you still have the issue, please provide a sample project which reproduces that error.
Hi, I would like to mention an issue I'm having with the library. I'm not completely sure if it's a bug or a misuse of it.
I'm building an electron app with create-react-app (which used webpack under the hood), app-react-rewired and typescript. Once I have the web app, I'm embedding it on electron to make it a desktop app. So, in the main electron file I have something like the following:
On the renderer side, when I try to import electron-log, I'm getting the following error:
I've reading about the error, and it is possible coming from babel. I tried to transpile the lib code with babel and the @babel/plugin-proposal-class-properties to try get rid of the error, so in the config-overrides.js (from app-react-rewired) I set up something like this:
After this setup, I got rid of the previous error, but now I'm having the following error:
That error seems to be coming from the fact that the lib is a commonjs module instead of a esmodule. At this point, I'm not sure how to proceed. Am I doing something wrong? Of course, I also tried using the elecronLog variable, but I get the "electronLog is undefined" error.
Whatever help or comment is appreciated. Thanks in advance.