Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Jan 21, 2025 · 0 comments

Comments

@DanTup
Copy link
Contributor

DanTup commented Jan 21, 2025

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
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant