When debugging (non-Flutter) web apps in VS Code, expression eval fails on some expressions with "Module dart_sdk not loaded in the browser".
I think this only started recently, as Dart-Code integration tests start failing which (as far as I can tell) were passing previously.
I'm not sure whether the issue is in webdev, dwds, or the SDK. Although I don't seem to be able to repro in Flutter web apps.
==> {
"id": "20",
"jsonrpc": "2.0",
"method": "evaluateInFrame",
"params": {
"disableBreakpoints": true,
"expression": "DateTime.now().year",
"frameIndex": 0,
"isolateId": "193"
}
}
<== {
"jsonrpc": "2.0",
"result": {
"type": "@Instance",
"id": "#StringInstanceRef#Error: Module dart_sdk not loaded in the browser.",
"kind": "String",
"identityHashCode": 154905552,
"class": {
"type": "@Class",
"id": "classes|dart:core|String",
"name": "String",
"library": {
"type": "@Library",
"id": "dart:core",
"name": "dart:core",
"uri": "dart:core"
}
},
"valueAsString": "Error: Module dart_sdk not loaded in the browser.",
"length": 49
},
"id": "20"
}
To repro, I:
- created a new project using the basic web template from
dart create (and VS Code's Dart: Create New Project command)
- created a
.vscode/launch.json setting program to web/ for the web debugger
{
"name": "dart_web_application_1",
"request": "launch",
"type": "dart",
"program": "web/"
}
- added a breakpoint into the
main function in main.dart
- launched with
F5
- when the app loaded, hit the Restart icon (since due to a race, breakpoints in startup code don't currently work for non-Flutter web debugging)
- when the debugger paused, tried to evaluate
DateTime.now().year in the Debug Console
When debugging (non-Flutter) web apps in VS Code, expression eval fails on some expressions with "Module dart_sdk not loaded in the browser".
I think this only started recently, as Dart-Code integration tests start failing which (as far as I can tell) were passing previously.
I'm not sure whether the issue is in webdev, dwds, or the SDK. Although I don't seem to be able to repro in Flutter web apps.
To repro, I:
dart create(and VS Code's Dart: Create New Project command).vscode/launch.jsonsettingprogramtoweb/for the web debugger{
"name": "dart_web_application_1",
"request": "launch",
"type": "dart",
"program": "web/"
}
mainfunction inmain.dartF5DateTime.now().yearin the Debug Console