Repository navigation
DevTools fails to load through proxies that don't support SSE #2892
Description
I tried to launch DevTools in a cloud editor that doesn't support SSE (its connections will just hang indefinitely) and it failed to load (just leaving a white screen after printing the version number to the console).
The network tab looks like this:
I can't easily confirm, but I think it will be hanging on this await here:
| await preferences.init(); |
That init() call tries to use storage which will be a ServerConnectionStorage because DevToolsServerConnection.connect does not return null here:
Lines 18 to 23 in f38f4ac
| // Here, we try and initialize the connection between the DevTools web app and | |
| // its local server. DevTools can be launched without the server however, so | |
| // establishing this connection is a best-effort. | |
| final connection = await DevToolsServerConnection.connect(); | |
| if (connection != null) { | |
| setGlobal(Storage, ServerConnectionStorage(connection)); |
It doesn't return null, because in connect() the call to api/ping works fine (it's not SSE), which then unconditionally creates an SseClient:
| static Future<DevToolsServerConnection> connect() async { |
If we want to support this, I think there are two options:
- Support WebSockets instead of SSE for this API (DWDS already has some abstractions over SSE+WebSockets that could probably be taken)
- Change this code to detect that SSE is not responsive and return
null(this would effectively disable the server though, which may affect some functionality)
@devoncarew @jacob314 I don't know if this is currently worth pursuing, but thought it was worth capturing the issue somewhere perhaps to come back to.

Activity
jacob314 commentedon Apr 13, 2021
Fyi @grouma
DanTup commentedon Sep 4, 2024
Another issue I believe is caused by SSE is not being able to open > 5 DevTools tabs, see #8298. If the fix for that issue is to switch from SSE to WS, that may also resolve this.