Skip to content

cannot log message when react app be loaded by electron  #808

@huyinghuan

Description

@huyinghuan

I create a react app and use debug , debug(xxx) can work well on browser. but on electron user window.loadUrl("http://localhost:3000") load page, open electron dev tools, debug() cannot work.

code demo: https://github.com/huyinghuan/debug-issue

setup install deps:

cd $project
yarn install
cd ui
yarn install

run react app

cd $project
cd ui
yarn start

open browser, http://localhost:3000 in console debug work well.

run electron:
new terminal

cd $project
yarn start

when loaded page, in dev tools debug output nothing.

react app index.js:

import React from 'react';
import ReactDOM from 'react-dom';
import Debug from "debug";
const debug = Debug("ui:App");
localStorage.debug = "ui:*"
debug("hello")
ReactDOM.render(
  <React.StrictMode>
    <div className="App">
      debug test
    </div>
  </React.StrictMode>,
  document.getElementById('root')
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    help-wantedThis issue has an actionable itemneeds-documentationThis issue or change requires additional documentationpr-welcomeThis issue has an approved change; a pull request would be appreciated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions