Skip to content

Expression eval fails with "Error: Module dart_sdk not loaded in the browser." #2869

Description

@DanTup

When debugging (non-Flutter) web apps in VS Code, expression eval fails on some expressions with "Module dart_sdk not loaded in the browser".

Image

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failurespackage:webdevtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions