Playground not loading on Android and Chrome
sumitsinghwp opened this issue ยท 13 comments
Hey,
I have tried to test playground in my mobile and it's loading countinue. I am using android OS.
Also when try to change php version in pop-up then still not able to change.
More information see record video.
Screenrecorder-2023-06-18-08-59-02-608.mp4
Could you tell us which browser you're using, in case it might be relevant?
I am using Google Chrome @eliot-akira
@sumitsinghwp I'm seeing the same thing, and I've let it load for near ten minutes. I don't have the console output, so I'm not sure what's going on. Any chance you can get a copy of the output logging and share? or anyone? I think one needs to connect to Android Studio or download some Dev Tools app to do this.
On Firefox on Android it's loading fine, so definitely not a network issue.
@ellatrix it looks like the Blocknotes issue you're experiencing too! Playground should be better about communication problems and at least say "network error, click here to retry" and output some useful info in devtools (if it doesn't already)
This is the code fragment at fault whenever the progress bar gets stuck at 50%:
wordpress-playground/packages/playground/client/src/index.ts
Lines 109 to 120 in e28db3b
I know that, because startPlaygroundWeb splits the progress bar in two halfs:
- 50% tracks PHP and WordPress loading
- 50% tracks Blueprint execution
This can be somewhat seen here:
wordpress-playground/packages/playground/client/src/index.ts
Lines 74 to 86 in e28db3b
I believe this await statement finishes, but it would be great to use a timeout and report a problem when it doesn't:
await playground.isReady();I think I saw the progress bar slowly moving forward for a tiny bit, which would suggest the first Blueprint step attempts to run:
wordpress-playground/packages/playground/blueprints/src/lib/compile.ts
Lines 260 to 274 in e28db3b
But, again a guess, it throws an error and never finishes. It would be lovely to display these errors in the UI to at least tell the user what's going on.
As to why โ I'm not sure yet. I've seen this happening when a cached remote.html is loaded and it attempts to download a non-existent php.wasm.
There is a slight chance that #561 solved this issue. We'll know for sure once new playground.wordpress.net is deployed โ perhaps tomorrow
Well it can't be a Blueprint error because those would advance the progress bar to completion (whether that behavior makes sense is a separate discussion):
wordpress-playground/packages/playground/blueprints/src/lib/compile.ts
Lines 113 to 142 in 3d78688
It can't be await playground.isConnected(); either, because it would fail after a timeout and the progress bar is only set up after isConnected() resolves:
wordpress-playground/packages/php-wasm/web/src/lib/api.ts
Lines 38 to 57 in 3d78688
Therefore, it's either playground.isReady() or something really surprising. That one wouldn't resolve if either:
The web worker doesn't report it's ready, and that would happen when it cannot load PHP or WordPress
wordpress-playground/packages/playground/remote/src/lib/worker-thread.ts
Lines 137 to 175 in 3d78688
The service worker is not getting registered
Either way, playground.isReady() should be updated to bubble up any errors to the user.
Does this work for you now by any chance, @sumitsinghwp? I wonder if any of the changes made in the meantime helped at all.
I'm closing this issue as I could not reproduce the problem on multiple Android browsers at browserstack. Feel free to comment if the problem pops up again @sumitsinghwp! Brownie points if you could provide the output from developer tools.
Here's what I saw in my testing:
Chrome on Pixel 7 (Android 12):
Chrome on Pixel 8 Pro (Android 13):
Galaxy S23 (Android 13):
Galaxy S22 Plus (Android 12):
Galaxy S21 (Android 11):

