Tech User
Tech User

Reputation: 157

Electron React : Unable to view console log from react

I have Electron app which access react app running on dev server. I use loadURL("http://localhost:3000/") to access the reactapp within electron. The react app having console logs however not able to view the logs anywhere. how do I view these log messages

NB: I am new to JS /react/Electron and come from enterprise java background

Upvotes: 1

Views: 705

Answers (2)

David Casanellas
David Casanellas

Reputation: 855

You need to export environment variables

POSIX shell example:

$ export ELECTRON_ENABLE_LOGGING=true
$ electron

Windows console example:

> set ELECTRON_ENABLE_LOGGING=true
> electron

Upvotes: 0

Bert'sfriend
Bert'sfriend

Reputation: 41

For the render process you can start here. https://electronjs.org/docs/tutorial/application-debugging

for the main process you can see here. https://electronjs.org/docs/tutorial/debugging-main-process

if you are using vscode you can use this handy guide. https://electronjs.org/docs/tutorial/debugging-main-process-vscode

Upvotes: 1

Related Questions