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:
|
// 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.
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
awaithere:devtools/packages/devtools_app/lib/main.dart
Line 28 in 43b2f5e
That
init()call tries to use storage which will be aServerConnectionStoragebecauseDevToolsServerConnection.connectdoes not return null here:devtools/packages/devtools_app/lib/src/config_specific/framework_initialize/_framework_initialize_web.dart
Lines 18 to 23 in f38f4ac
It doesn't return null, because in
connect()the call toapi/pingworks fine (it's not SSE), which then unconditionally creates anSseClient:devtools/packages/devtools_app/lib/src/server_api_client.dart
Line 28 in 86102bd
If we want to support this, I think there are two options:
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.