Experience-Monks / hihat

:tophat: local Node/Browser development with Chrome DevTools
MIT License
443 stars 19 forks source link

Immediate quit in --node REPL #19

Closed lingo closed 9 years ago

lingo commented 9 years ago

If I run hihat I get a javascript REPL in the devtools, but if I run hihat --node then the window briefly flashes open and closes instantly.

After some fiddling with the source code it seems to be this block in hihat/index.js:136 that is reached:


        // if DevTools is the only window and it closes,
        // then quit the app
        if (opts.node && (opts.devtool !== false && (bounds.width === 0 && bounds.height === 0))) {
          // BUG: there is a bug where this fails when 'node-integration: false'
          // will need to revisit upstream in Electron
          mainWindow.once('devtools-closed', function () {
            mainWindow.close()
          })
        }

If I run hihat with a frame size set then I don't get the immediate quit, e.g. hihat --node --frame 320,200.

Edit This is on Ubuntu 14.04.2 LTS. Perhaps hihat can auto-size the frame better?

mattdesl commented 9 years ago

Thanks for the bug report!

I've pushed a patch in 2.4.1 that removes this code, so it should work again for you.

The code was in place to close the process when the DevTools window is closed. I will open another ticket to explore better ways of doing that. :smile:

lingo commented 9 years ago

Great, thank you! I'll check the new version.