Skip to content

ChromeDebugException #697

@zanderso

Description

@zanderso

With the Flutter tool invoked with run --machine --target lib/main.dart -d chrome --track-widget-creation --start-paused on dwds 0.6.2, from crash logging with backtrace:

ChromeDebugException: [error text copied below]
  | at handleErrorIfPresent | (chrome_proxy_service.dart:599 )
  | at AppInspector._constructLibrary | (inspector.dart:349 )
  | at <asynchronous gap> | (async )
  | at AppInspector._getLibrary | (inspector.dart:276 )
  | at <asynchronous gap> | (async )
  | at AppInspector.scriptRefs | (inspector.dart:479 )
  | at <asynchronous gap> | (async )
  | at AppInspector.getScripts | (inspector.dart:467 )
  | at <asynchronous gap> | (async )
  | at AppInspector.scriptRefFor | (inspector.dart:461 )
  | at <asynchronous gap> | (async )
  | at Debugger._frameFor | (debugger.dart:392 )
  | at <asynchronous gap> | (async )
  | at Debugger.dartFramesFor | (debugger.dart:315 )
  | at <asynchronous gap> | (async )
  | at Debugger._pauseHandler | (debugger.dart:432 )
  | at <asynchronous gap> | (async )
  | at _rootRunUnary | (zone.dart:1132 )
  | at _CustomZone.runUnary | (zone.dart:1029 )
  | at _CustomZone.runUnaryGuarded | (zone.dart:931 )
  | at CastStreamSubscription._onData | (async_cast.dart:81 )
  | at _rootRunUnary | (zone.dart:1132 )
  | at _CustomZone.runUnary | (zone.dart:1029 )
  | at _CustomZone.runUnaryGuarded | (zone.dart:931 )
  | at _BufferingStreamSubscription._sendData | (stream_impl.dart:336 )
  | at _BufferingStreamSubscription._add | (stream_impl.dart:263 )
  | at _SinkTransformerStreamSubscription._add | (stream_transformers.dart:68 )
  | at _EventSinkWrapper.add | (stream_transformers.dart:15 )
  | at WipDomain.eventStream.<anonymous closure>.<anonymous closure> | (webkit_inspection_protocol.dart:295 )
  | at _HandlerEventSink.add | (stream_transformers.dart:228 )
  | at _SinkTransformerStreamSubscription._handleData | (stream_transformers.dart:120 )
  | at _rootRunUnary | (zone.dart:1132 )
  | at _CustomZone.runUnary | (zone.dart:1029 )
  | at _CustomZone.runUnaryGuarded | (zone.dart:931 )
  | at _BufferingStreamSubscription._sendData | (stream_impl.dart:336 )
  | at _DelayedData.perform | (stream_impl.dart:591 )
  | at _StreamImplEvents.handleNext | (stream_impl.dart:707 )
  | at _PendingEvents.schedule.<anonymous closure> | (stream_impl.dart:667 )
  | at _rootRun | (zone.dart:1120 )
  | at _CustomZone.run | (zone.dart:1021 )
  | at _CustomZone.runGuarded | (zone.dart:923 )
  | at _CustomZone.bindCallbackGuarded.<anonymous closure> | (zone.dart:963 )
  | at _rootRun | (zone.dart:1124 )
  | at _CustomZone.run | (zone.dart:1021 )
  | at _CustomZone.runGuarded | (zone.dart:923 )
  | at _CustomZone.bindCallbackGuarded.<anonymous closure> | (zone.dart:963 )
  | at _microtaskLoop | (schedule_microtask.dart:41 )
  | at _startMicrotaskLoop | (schedule_microtask.dart:50 )
  | at _runPendingImmediateCallback | (isolate_patch.dart:116 )
  | at _RawReceivePortImpl._handleMessage | (isolate_patch.dart:173 )

Here's the message from the exception object:

Unexpected error from chrome devtools:
text: Uncaught
exception:
  description: ReferenceError: require is not defined
    at <anonymous>:2:25
    at <anonymous>:50:7
  type: object
  value: null
attempted JS eval: `    (function() {
         var sdkUtils = require('dart_sdk').dart;
   var library = sdkUtils.getLibrary('package:flutter/src/painting/decoration_image.dart');
   if (!library) throw 'cannot find library for package:flutter/src/painting/decoration_image.dart';
  
      var parts = sdkUtils.getParts('package:flutter/src/painting/decoration_image.dart');
      var result = {'parts' : parts}
      var classes = Object.values(Object.getOwnPropertyDescriptors(library))
        .filter((p) => 'value' in p)
        .map((p) => p.value)
        .filter((l) => l && sdkUtils.isType(l));
      var classList = classes.map(function(clazz) {
        var descriptor = {'name': clazz.name};

        // TODO(jakemac): static methods once ddc supports them
        var methods = sdkUtils.getMethods(clazz);
        var methodNames = methods ? Object.keys(methods) : [];
        descriptor['methods'] = {};
        for (var name of methodNames) {
          var method = methods[name];
          descriptor['methods'][name] = {
            // TODO(jakemac): how can we get actual const info?
            "isConst": false,
            "isStatic": false,
          }
        }

        // TODO(jakemac): static fields once ddc supports them
        var fields = sdkUtils.getFields(clazz);
        var fieldNames = fields ? Object.keys(fields) : [];
        descriptor['fields'] = {};
        for (var name of fieldNames) {
          var field = fields[name];
          var libraryUri = Object.getOwnPropertySymbols(fields[name]["type"])
          .find(x => x.description == "libraryUri");
          descriptor['fields'][name] = {
            // TODO(jakemac): how can we get actual const info?
            "isConst": false,
            "isFinal": field.isFinal,
            "isStatic": false,
            "classRefName": fields[name]["type"]["name"],
            "classRefLibraryId" : field["type"][libraryUri],
          }
        }

        return descriptor;
      });
      result['classes'] = classList;
      return result;
    })()
    `

/cc @jakemac53 @jonahwilliams

Metadata

Metadata

Assignees

Labels

customer-fluttertype-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