Skip to content

Breakpoints break in wrong location in unnamed extensions: FrameComputer: Error calculating sync frame: RangeError (end): Invalid value: Not in inclusive range 15..26: 10 #2574

Open
@DanTup

Description

@DanTup

This was originally raised at Dart-Code/Dart-Code#5394 by @markbeij.

Breakpoints in unnamed extensions don't seem to work on web, instead execution pauses on the parent frame and an error is printed:

FrameComputer: Error calculating sync frame: RangeError (end): Invalid value: Not in inclusive range 15..26: 10

The message appears to come from here:

logger.warning('Error calculating sync frame: $e');

Here I have a breakpoint on line 20 (return this) but execution paused at the parent frame:

Image

Example code:

import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(body: Center(child: Text(''.myExtension()))),
    );
  }
}

extension on String {
  String myExtension() {
    return this; // Breakpoint on this line
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions