-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App starts, but GUI window does not show up #911
Comments
Streamlink Twitch GUI is based on NW.js, and similar to Electron and other frameworks based on Chromium, there's almost nothing that can be done here on the application level if users are having issues with running NW.js itself. The only thing that can be done here is bumping the used NW.js release to the latest version or settings certain Chromium launch parameters. Streamlink Twitch GUI
The log output you've provided doesn't say anything useful. And since you're running macOS using an Apple M2 processor, there won't be any official support anyway, since it's ARMv8.X and not x86_64, and thus needs to be emulated. The application is running perfectly fine in my macOS Monterey x86_64 virtual machine. Please try running NW.js on its own and check if that works: Otherwise, try to disable GPU acceleration via Chromium's |
Thanks for your fast reply! Is there anything else I can try to give you some more useful logs for debugging the issue? I tried nwjs 0.68.1 and 0.69.1 and both opened a window. I also tried to start it with "--disable-gpu" but the behaviour did not change and I got the same Error Message:
|
Is Streamlink Twitch GUI maybe already running on your system? Remember that this is a so called singleton application and can only be run once at the same time, so any additional launch attempts won't work. Check the running processes on your system and check for any left-over hanging/zombie processes in the background that may prevent you from starting it. Also try deleting the application's user data dir or set a temporary custom one using the As you can see in the changelog of As a last attempt, you could try building the application on your own with NW.js bumped to the latest version in Other than that, I have no idea and can't further help. I don't use macOS and I don't own anything made by that company. Without any clear details, this is impossible for anyone else to debug. Since you've been the only one so far after 24+ days since the v2.2.0 release who's having issues launching the app, this sounds more like an issue on your system and its configuration. |
Did a bisect today:
So yes, it really seems to be the nwjs update to 0.68.1. Also tried 0.69.1, but did not run. Can you help me and tell me how to stop it from downloading nwjs and use a folder where i can checkout nwjs and do another bisect on that? |
I've already told you that this was the only relevant change between the last two releases. Bisecting was not necessary.
You'll have to find a reproduction on a bare NW.js project and report the issue on the NW.js issue tracker. Since you're able to run NW.js 0.69.1 without any application content, maybe check if these Chromium parameters are in any way related to the crash: Checking which part of the application code is crashing NW.js on your system will be much, much more challenging. This could be either a bug in the NodeJS APIs or Chromium.
The NW.js setup is handled by the The easiest way will be replacing the NW.js binaries of the currently set version with ones from the available live builds here, so you don't have to fiddle with the build config: If you feel like digging through the NW.js code, go here: Good luck. |
Changing the Chromium args did not help in any way, in some cases it made it even worse. If I change "show" to "true" it works and the window shows up:
I made a pull request for you to test it #912 |
From what it looks like, the dev tools aren't available anymore on http://localhost:8888 when running a dev build via If you apply this patch and run a development build, it'll at least open the dev tools window, so maybe this will help. It may be required though to reload the dev tools once with diff --git a/src/app/main.js b/src/app/main.js
index 8628e125..9c633d99 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -29,6 +29,14 @@ global.process.on( "uncaughtException", function( err ) {
});
+/* istanbul ignore next */
+if ( DEVELOPMENT ) {
+ try {
+ require( "nw.gui" ).Window.get().showDevTools();
+ } catch ( e ) {}
+}
+
+
// "pre-load" certain native node modules
// prevents a bug on Windows which causes all methods of stream.Writable.prototype to be missing
// on stream.Duplex.prototype, more specifically stream.Duplex.prototype.cork. Also related to |
Sadly, I can't do development builds (I guess because the arch is not supported, don't really want to debug that), so I have to make release builds. streamlink-twitch-gui % git diff
diff --git a/src/app/main.js b/src/app/main.js
index 8628e125..495878c8 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -29,6 +29,13 @@ global.process.on( "uncaughtException", function( err ) {
});
+/* istanbul ignore next */
+if ( DEVELOPMENT ) {}
+try {
+ require( "nw.gui" ).Window.get().showDevTools();
+} catch ( e ) {}
+
+
// "pre-load" certain native node modules
// prevents a bug on Windows which causes all methods of stream.Writable.prototype to be missing
// on stream.Duplex.prototype, more specifically stream.Duplex.prototype.cork. Also related to
diff --git a/src/app/package.json b/src/app/package.json
index 749f491b..80d3bfa3 100644
--- a/src/app/package.json
+++ b/src/app/package.json
@@ -19,5 +19,5 @@
"show_in_taskbar": false
},
- "chromium-args": "--disable-devtools --enable-features=NativeNotifications --disable-smooth-scrolling --disable-features=nw2"
+ "chromium-args": "--enable-features=NativeNotifications --disable-smooth-scrolling --disable-features=nw2"
}
diff --git a/src/config/main.json b/src/config/main.json
index 4da5acf7..2ca6d731 100644
--- a/src/config/main.json
+++ b/src/config/main.json
@@ -1,7 +1,7 @@
{
"display-name": "Streamlink Twitch GUI",
"app-identifier": "streamlink-twitch-gui",
- "nwjs-version": "0.68.1",
+ "nwjs-version": "0.69.1",
"urls": {
"homepage": "https://github.com/streamlink/streamlink-twitch-gui",
"release": "https://github.com/streamlink/streamlink-twitch-gui/releases/tag/v{version}", |
dev tools are not available on the "normal" NW.js flavor, only on the SDK flavor which is used by development and debug builds |
That's because it's not an application error. You'll have to figure out why the main window doesn't appear. As said in your PR (which I'm going to close now), the application window starts hidden and only gets made visible once fully initialized if no launch arguments were passed that prevent it from being shown, like So set a breakpoint here and reload the application via Then see if the following call to Another possibility is the window position, which could have an offset, so you can't see it on your screen. Streamlink Twitch GUI however does have an out-of-bounds detected implemented and should reset the window position. Either way, you can check the window coordinates as well now. Get the window object via |
I can set as many breakpoints as I want in that function, it doesn't pause when refreshing.
If I do |
Then check here, which is one level up the call stack: Not reaching this code path is however a bit surprising and indicates that it's caused by a failure of the initialization (on your system). One of the init steps on macOS is the setup of the application menu bar, via the NW.js JS interfaces: |
Last breakpoint that pauses is here: streamlink-twitch-gui/src/app/init/instance-initializers/nwjs/instance-initializer.js Line 59 in 589d3e3
The breakpoint at requestAnimationFrame( resolve ) pauses, a breakpoint at i++ one line above does not pause.
|
So |
Looks like I've uploaded a demo here:
As you can see, requesting an animation frame during the initial window state works fine, on both Linux and macOS, but when the window gets set to hidden again after making it visible, requesting an animation frame does not work. That doesn't explain though why Streamlink Twitch GUI's initialization isn't working on your system. Could you please clone the demo repo and pass the directory path as the first argument to the nwjs executable and post the resulting log output? The whole And just for reference, If the source of this issue can't be found, then this can be worked around by creating a wrapping promise object that resolves automatically after a couple of milliseconds, as a fallback to the two |
Also I just tried to comment out the for-loop and the window gets shown and no white window is shown beforehand like when I set show to true in package.json. |
The log output doesn't say much. It's the same as the ones from the CI runners. The If we load the initial route first without awaiting its transition and then wait for the I also tried adding a Please report back if the following diff fixes the issue: diff --git a/src/app/init/instance-initializers/nwjs/instance-initializer.js b/src/app/init/instance-initializers/nwjs/instance-initializer.js
index 13288506..537f76f2 100644
--- a/src/app/init/instance-initializers/nwjs/instance-initializer.js
+++ b/src/app/init/instance-initializers/nwjs/instance-initializer.js
@@ -52,13 +52,6 @@ export default {
// restore window position first (while being hidden)
await windowInitializer( application );
- // wait until Ember has rendered the app for the first time (window is still hidden)
- await new Promise( resolve => scheduleOnce( "afterRender", resolve ) );
- // assume that NW.js doesn't render a white page anymore after the next two frames
- for ( let i = 0; i < 2; i++ ) {
- await new Promise( resolve => requestAnimationFrame( resolve ) );
- }
-
// wait until the target route is loaded
const routeName = await routingPromise;
// then load the user's homepage, but don't await the completion of the transition
@@ -66,6 +59,9 @@ export default {
router.homepage( true );
}
+ // wait until Ember has rendered the app for the first time (window is still hidden)
+ await new Promise( resolve => scheduleOnce( "afterRender", resolve ) );
+
// add "initialized" class name to the document element just before showing the window
const document = application.lookup( "service:-document" );
document.documentElement.classList.add( "initialized" ); |
Did a fresh clone, applied the patch, built a release and yes, this fixes the issue. Thank you! :) |
I will push these changes once I've completed some further tests later today / tomorrow. Thanks for helping. |
I found a better fix which doesn't involve starting the application routing before awaiting the first application rendering callback. This means that the initial animation when launching the app won't be cut off on slow(er) systems. |
Checklist
Streamlink Twitch GUI version
2.2.0
Streamlink version
5.0.1
Operating system, environment and configuration details
System Version: macOS 12.6 (21G115)
Model Name: MacBook Air
Model Identifier: Mac14,2
Chip: Apple M2
Description
In 2.2.0 Streamlink Twich GUI does launch, but no windows appear.
In 2.1.0 it works, so it seems to be something introduced in this release.
Hope I used the right commands for the debug log, if not, please tell me.
Debug log
The text was updated successfully, but these errors were encountered: