Closed christopherfujino closed 2 years ago
cc @elliette and @DanTup, it looks like the debug addapter is not playing nice with dwds?
This looks like a null-safety incompatibility:
RPCError: setIsolatePauseMode: (-32603) setIsolatePauseMode: NoSuchMethodError: Class 'ChromeProxyService' has no instance method 'setIsolatePauseMode' with matching arguments.Receiver: Instance of 'ChromeProxyService'
Tried calling: setIsolatePauseMode("1", exceptionPauseMode: "Unhandled", shouldPauseOnExit: null)
Found: setIsolatePauseMode(String, {String exceptionPauseMode, bool shouldPauseOnExit}) => Future<Success>#0
DWDS is now fully migrated to null-safety. I'm guessing doing a release of DWDS should resolve this, but let me confirm.
This looks like a null-safety incompatibility:
RPCError: setIsolatePauseMode: (-32603) setIsolatePauseMode: NoSuchMethodError: Class 'ChromeProxyService' has no instance method 'setIsolatePauseMode' with matching arguments.Receiver: Instance of 'ChromeProxyService'Tried calling: setIsolatePauseMode("1", exceptionPauseMode: "Unhandled", shouldPauseOnExit: null)Found: setIsolatePauseMode(String, {String exceptionPauseMode, bool shouldPauseOnExit}) => Future<Success>#0
DWDS is now fully migrated to null-safety. I'm guessing doing a release of DWDS should resolve this, but let me confirm.
ahh, good catch
Assigning to myself to investigate
the debug adapter code is coming from dds 2.2.0 vm_service 8.2.2 dwds 12.1.1
From reading the code at https://github.com/dart-lang/webdev/blob/1931dc9daa61036ca7742cc6beca2bfbedeba75c/dwds/lib/src/services/chrome_proxy_service.dart, it actually seems like the dwds:12.1.1 version of ChromeProxyService
doesn't even implement the .setIsolatePauseMode()
method, but I don't know how this isn't a compiler error. It IS part of the VmServiceInterface
that ChromeProxyService
implements: https://github.com/dart-lang/sdk/blob/400bad75440e463b1fb584157df36415dd03afdd/pkg/vm_service/lib/src/vm_service.dart#L1108. I might be getting mixed up with my revision hashes...
Ah okay. DWDS v12.1.1
doesn't have the setIsolatePauseMode
method, that was added in v14.0.3
: https://github.com/dart-lang/webdev/blob/master/dwds/CHANGELOG.md#1403
Here was the tracking issue for that: https://github.com/dart-lang/webdev/issues/1627
Trying to think of the best way to resolve this (I don't think we want to cherrypick in v14.0.3
of DWDS since there are a lot of changes between that and v12.1.1
Ah okay. DWDS
v12.1.1
doesn't have thesetIsolatePauseMode
method, that was added inv14.0.3
: https://github.com/dart-lang/webdev/blob/master/dwds/CHANGELOG.md#1403Here was the tracking issue for that: dart-lang/webdev#1627
Trying to think of the best way to resolve this (I don't think we want to cherrypick in
v14.0.3
of DWDS since there are a lot of changes between that andv12.1.1
I'm stumped on how this compiles though, since it seems to me like the version of vm_service we're using includes this method in the interface we're implementing.
Trying to think of the best way to resolve this (I don't think we want to cherrypick in
v14.0.3
of DWDS since there are a lot of changes between that andv12.1.1
Fortunately our beta branch is beyond this, I think we're ok not backporting to stable: https://github.com/flutter/flutter/blob/beta/packages/flutter_tools/pubspec.yaml#L14
Ah okay. DWDS
v12.1.1
doesn't have thesetIsolatePauseMode
method, that was added inv14.0.3
: https://github.com/dart-lang/webdev/blob/master/dwds/CHANGELOG.md#1403 Here was the tracking issue for that: dart-lang/webdev#1627 Trying to think of the best way to resolve this (I don't think we want to cherrypick inv14.0.3
of DWDS since there are a lot of changes between that andv12.1.1
I'm stumped on how this compiles though, since it seems to me like the version of vm_service we're using includes this method in the interface we're implementing.
Oh nevermind, it still compiles because there's a noSuchMethod
method implemented.
Closing this as a duplicate of https://github.com/dart-lang/webdev/issues/1627 which was fixed upstream, including in the current 3.3 beta.
Isn't the issue here that the method signature doesn't match because shouldPauseOnExit
is not nullable in the current (released) DWDS rather than it being missing?
If so, it looks like that is fixed much more recently by https://github.com/dart-lang/webdev/pull/1687 which isn't in a DWDS release yet?
Isn't the issue here that the method signature doesn't match because
shouldPauseOnExit
is not nullable in the current (released) DWDS rather than it being missing?If so, it looks like that is fixed much more recently by dart-lang/webdev#1687 which isn't in a DWDS release yet?
looks can be deceiving. I initially thought this, however I'm pretty sure that the real issue is that our version of dwds and thus ChromeProxyService
does not implement the method at all; it still compiles because it implements noSuchMethod
, which is at the top of our stacktrace.
Isn't the issue here that the method signature doesn't match because
shouldPauseOnExit
is not nullable in the current (released) DWDS rather than it being missing?
This is happening on stable, not the currently released dwds.
I initially thought this, however I'm pretty sure that the real issue is that our version of dwds and thus
ChromeProxyService
does not implement the method at all; it still compiles because it implementsnoSuchMethod
Oh, weird. The "Found" line seems to match the signature of the current release:
Instance of 'ChromeProxyService' Tried calling: setIsolatePauseMode("1", exceptionPauseMode: "Unhandled", shouldPauseOnExit: null) Found: setIsolatePauseMode(String, {String exceptionPauseMode, bool shouldPauseOnExit}) => Future
Although it occurs to me now that before the PR linked above, the file was marked as // @dart = 2.9
so I think the argument would be implicitly nullable anyway, so shouldn't cause this type of error.
I'll make a note to double check this on beta tomorrow anyway. I don't recall how much testing I did with a web device, and with DWDS there's a lot of different code running compared to the VM.
Oh, weird. The "Found" line seems to match the signature of the current release:
Instance of 'ChromeProxyService' Tried calling: setIsolatePauseMode("1", exceptionPauseMode: "Unhandled", shouldPauseOnExit: null) Found: setIsolatePauseMode(String, {String exceptionPauseMode, bool shouldPauseOnExit}) => Future
I think what is happening is that the "Found" refers to the interface type, however this is not an implementation, but a declaration without a body. FWIW, the interface implementation has a nullable bool?.
I tested on current beta and indeed this is working fine (it doesn't have the latest DWDS null safety changes, but the library is marked as 2.9 so is implicitly nullable):
[8:57:16 AM] [DAP] [Info] ==> {"command":"setExceptionBreakpoints","arguments":{"filters":["All","Unhandled"]},"type":"request","seq":11}
[8:57:16 AM] [General] [Info] [Flutter (Chrome)] ==> [VM] {"jsonrpc":"2.0","id":"623","method":"setIsolatePauseMode","params":{"isolateId":"1","exceptionPauseMode":"All"}}
[8:57:16 AM] [General] [Info] [Flutter (Chrome)] <== [VM] {"jsonrpc":"2.0","result":{"type":"Success"},"id":"623"}
So it does seem all is good and there's nothing to do, sorry for the diversion!
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
On stable/3.0.5 Command
flutter debug_adapter
Note that there is an entire Dart stacktrace on the first line, which is part of the Exception message