Giter Club home page Giter Club logo

Comments (8)

CMTegner avatar CMTegner commented on July 21, 2024

It's also worth mentioning that debugger statements aren't working as expected until the app is fully launched, leading me to think that the source is executed before the debugger is attached.

from devtool.

CMTegner avatar CMTegner commented on July 21, 2024

Must have missed this during my first read-through of the readme:

When the DevTools window first opens, you may need to reload the browser for source maps and debugging to work correctly (related: electron#2379)

from devtool.

mattdesl avatar mattdesl commented on July 21, 2024

most debug tools can add breakpoints to sum.js first, then I can select this file run as debug mode, so in this way I can debug the code easy.

Electron doesn't (yet) provide a way to inject break points like this.

Right now you will need to run the DevTool, set a break point, and then reload (Cmd + R or Ctrl + R) before the debugger and source maps work nicely.

It's also worth mentioning that debugger statements aren't working as expected until the app is fully launched, leading me to think that the source is executed before the debugger is attached.

@s-a Did you also have this issue in iron-node? If so how did you get around it?

from devtool.

s-a avatar s-a commented on July 21, 2024

In ironNode I am waiting for DevTools opened event. After that I launch a debug session.
https://github.com/s-a/iron-node/blob/54fd8aa1cfb01d970ffd6d625cf81247b4f7510c/app/index.js#L100

from devtool.

mattdesl avatar mattdesl commented on July 21, 2024

Thanks @s-a – it seems obvious now. 😄

@CMTegner Your issue should be fixed in 1.3.1; you no longer need to reload the page for debugger statement or source maps to work.

EDIT: It looks like sometimes it still isn't getting caught. Investigating...

from devtool.

CMTegner avatar CMTegner commented on July 21, 2024

Just gave 1.3.1 a quick test, and during my – very limited – testing debugger statements seem to be working as expected. Great work @mattdesl!

from devtool.

mattdesl avatar mattdesl commented on July 21, 2024

I just fixed up the previous commit so it is a bit more robust – the debugger should now be active by the time the app loads.

I also added a --break option to the CLI in 1.4.0 which injects a hidden debugger statement into the first line of your entry file, allowing it to "break on first run" like with node-inspector. This is particularly useful if you need to debug something that you can't just reload (i.e. the script depends on process.stdin which is only sent once).

Hopefully this issue is all cleared up, now. 😄

from devtool.

rockcoder23 avatar rockcoder23 commented on July 21, 2024

yep~ sounds very nice! thanks a lot~~ 😄 👍

from devtool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.