-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Debugging is difficult/impossible when attempting code modifications #922
Comments
Nevermind, I always seem to have a breakthrough right after I've given up. Was able to get the console.log to show with the following change to the launch command: Notice the replacement of opening the app with the calling of the actual executable in the generated app contents. This leaves the command line blocked while the app runs and outputs the console log messages there. Sorry for the annoyance. |
@TheCleric glad you figured it out 🙂! So, what was missing in your case, and is there anything we can improve in our developer docs for better clarity and visibility? |
I would be specific that when making a code modification, console.log debug messages from the main process will be outputted to the command line (per Electron). Also give an indication on how to run the app from a command line for the various platforms so that the console.log messages will be visible. This should be fairly obvious (to me) for Windows and Linux, but is a bit more esoteric (to me) for OSX (but some people would probably say these are all obvious, lol). |
@TheCleric nah, good comments, thanks. The development world is vast and what's obvious to Alice is brainfuck to Bob, so I enriched |
@TheCleric by the way, if working on big new stuff, wait a bit for #898 to land, or you're in for a hell of a conflict resolution. And tests welcome for your use case with branch |
Will do. Let me know when it's ready. I'm planning on adding this Find In Text feature, and as well a possible adblock option flag. |
@TheCleric Nativefier 8.x is getting stable as of 8.0.4, so now would be a reasonable time for you to try adding these features. Relevant issues for both, with potentially-interesting ideas and implementation options: |
Yeah seeing #29 is what spurred this on, and I have a few ideas that aren't brought up in #177. Specifically following along with this thread: https://discuss.atom.io/t/resolved-adblock-for-electron-app/39396/6 And possibly using this node library mentioned therein: https://www.npmjs.com/package/abp-filter-parser I've got search about half working at the moment (get a search dialog to show up, performing a search, getting a match count) but running into a few snags (search box losing focus on input event, search matches no highlighting like they were when I began testing this at a lower level). Gonna keep working on it, but would be open to a collaboration if you have time. 😄 |
@TheCleric cool. Sure, please write and share your questions in the two issues:
|
Sounds good. |
Bug description
When modifying nativefier source in order to implement a "Find" menu command, debugging is difficult because logging seems to get swallowed. I've tried the following:
console.log (which seems to output to command line for the main process in an electron app, which nativefier doesn't seem to have since it's an app)
The electron-log library which does not seem to actually output any files
Using the fs.appendFile function directly to implement my own logging system also seems to not create any files as directed
Using executeJavaScript to inject the log message into the dev tools console which does not actually display
Using the --verbose command line option which I can not seem to find any effect of using
I looked at
nativefier --help
and https://github.com/jiahaog/nativefier/blob/master/docs/api.md , I'm sure I'm not misunderstanding expected behavior.I searched existing open & closed issues. Yes, my bug is new.
Steps to reproduce
npm run clean && npm run-script build && node lib/cli.js https://myth-weavers.com/ --name "Myth Weavers" ~/Downloads/ && open ~/Downloads/Myth\ Weavers-darwin-x64/Myth\ Weavers.app --args --inspect --verbose
Expected behavior
I would expect to see a debug log somewhere, preferably in the dev tools console, but in a file if that's not available.
Actual behavior
No logging occurs.
Logs & screenshots
Command output Logs:
[03:50:52] Failed to load external module @babel/register
[03:50:52] Requiring external module babel-register
[03:50:52] Using gulpfile ~/Dev/nativefier/gulpfile.babel.js
[03:50:52] Starting 'clean'...
[03:50:52] Finished 'clean' after 12 ms
[03:50:53] Failed to load external module @babel/register
[03:50:53] Requiring external module babel-register
[03:50:53] Using gulpfile ~/Dev/nativefier/gulpfile.babel.js
[03:50:53] Starting 'build'...
[03:50:53] Starting 'clean'...
[03:50:53] Finished 'clean' after 6.87 ms
[03:50:53] Starting 'build-cli'...
[03:50:53] Starting 'build-static-js'...
[03:50:53] Starting 'build-static-not-js'...
[03:50:54] Finished 'build-static-not-js' after 240 ms
[03:50:54] Finished 'build-static-js' after 299 ms
[03:50:54] Starting 'build-static'...
[03:50:54] Finished 'build-static' after 18 μs
[03:50:54] Starting 'build-app'...
[03:50:55] Version: webpack 4.42.0
Built at: 03/15/2020 3:50:55 AM
Asset Size Chunks Chunk Names
main.js 425 KiB 0 [emitted] main
main.js.map 345 KiB 0 [emitted] [dev] main
Entrypoint main = main.js main.js.map
[03:50:55] Finished 'build-app' after 1.19 s
[03:50:55] Finished 'build-cli' after 1.52 s
[03:50:55] Finished 'build' after 1.53 s
packaging [============================== ] 60%Packaging app for platform darwin x64 using electron v5.0.13
Context
The text was updated successfully, but these errors were encountered: