Skip to content

[dwds/webdev] Latest -dev SDK constraint allows for 3.1.0 stable without new DDC debugger API #53459

Closed
@parlough

Description

@parlough

For some reason, changes that landed in 3.1.0-263.0-dev through 3.1.0-348.0-dev weren't part of Dart 3.1.0 stable. As a result, the new DDC runtime debugger API (which landed during this period) is not available for users of a stable SDK.

However, the SDK constraint of package:dwds and package:webdev of >=3.1.0-340.0.dev which is correct for -dev releases, also allows for a 3.1.0 stable SDK without the changes. So if you have a 3.1.X stable Dart version and run dart pub global activate webdev resolution will allow for package:webdev:3.0.7, but once debugging an app, you will get issues due to the incompatibilities.

Steps to reproduce:

  1. Use a stable Dart 3.1.0 SDK: 3.1.0 or 3.1.1 currently.
  2. Create a new project: dart create -t web my_app
  3. Debug it with webdev with your preferred mechanism: webdev serve --debug
  4. Add a breakpoint and debug main() and try to evaluate something to get an error.
An example resulting error when trying to evaluate main
[WARNING] Library org-dartlang-app:///web/main.dart is not loaded. This can happen for unreferenced libraries.
[WARNING] Failed to evaluate expression 'main'. 
[INFO] Unexpected error from chrome devtools:
text: Uncaught
exception:
  preview: null
  description: TypeError: dart.getFunctionMetadata is not a function
    at Function.<anonymous> (<anonymous>:4:21)
  type: object
  value: null
attempted JS eval: `      function() {
        const sdk = require('dart_sdk');
        const dart = sdk.dart;
        return dart.getFunctionMetadata(this);
      }
    `
stack trace:
()  3:20
:#0      handleErrorIfPresent (package:dwds/src/utilities/server.dart:91:5)
dart-lang/webdev#1      FunctionMetaData.metaDataFor (package:dwds/src/debugging/metadata/function.dart:36:5)
<asynchronous suspension>
dart-lang/webdev#2      StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:127:15)
<asynchronous suspension>

Related discussion: #53298 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions