retrace 1.2.0

  • Readme
  • Changelog
  • Installing
  • 44

retrace #

A command line utility to regenerate stack traces for minified Dart applications compiled with dart2js.

Installation #

pub global activate retrace

Usage #

retrace takes a source map file generated by dart2js and a minified stack trace. This is combined into a readable stack trace with original source code locations. For example:

bash$ dart2js someapp.dart

produces the following files


To run a retrace:

bash$ retrace
Paste your minified trace here:

Now, paste the minified stack trace into the console. Add a blank line to get the resulting stack trace:

ArgumentError - foo is null
    at Error (native)
    at WK.X4 (
    at lx.R1 (

ArgumentError - foo is null
    at Error (native)
    at web_audio/dart2js/web_audio_dart2js.dart:256 createBuffer (col 3)
    at someapp/base.dart:458                        setupAudio  (col 12)

More info #

Written by Björn Melinder. The source code can be found at - any pull requests and suggestions are more than welcome. Happy bug hunting :)

Changelog #

1.2.0 #

  • Works on dart 2, thanks to spebbe for patch.

1.1.1 #

  • Added support for parsing traces generated from the Trace class of the stack_trace dart package.

1.1.0 #

  • Added --format option which accepts either a 'text' or 'json' argument. Text format, the default, prints the same as before. The json format pretty-prints a list of objects whith keys source, raw, line and column. Thanks to Danny Kirchmeier for this patch!

1.0.3 #

  • Improved support for non-interactive use. The "Paste your minified trace here:" message is only printed if stdin is a terminal. The escape codes to colorize output are only printed if stdout is a terminal. Thanks to Matt Liberty for this patch!

1.0.2 #

  • Bug fix; when program exited with an error code it was rerun by pub global activate wrapper script.

1.0.1 #

  • Bug fix; pub global activate did not create the binary.

1.0.0 #

  • Initial version.

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate retrace

2. Use it

The package has the following executables:

$ retrace

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  retrace: ^1.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:retrace/retrace.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health issues and suggestions

Document public APIs. (-0.14 points)

33 out of 34 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/retrace.dart. (-6.78 points)

Analysis of lib/retrace.dart reported 14 hints, including:

line 13 col 18: Unnecessary new keyword.

line 16 col 13: Unnecessary new keyword.

line 25 col 20: Unnecessary new keyword.

line 34 col 22: Unnecessary new keyword.

line 49 col 18: Unnecessary new keyword.

Fix bin/retrace.dart. (-2.96 points)

Analysis of bin/retrace.dart reported 6 hints, including:

line 9 col 16: Unnecessary new keyword.

line 31 col 20: Unnecessary new keyword.

line 32 col 38: 'TERMINAL' is deprecated and shouldn't be used. Use terminal instead.

line 33 col 7: DO use curly braces for all flow control structures.

line 40 col 22: Unnecessary new keyword.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and retrace.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.0 <3.0.0
args ^1.5.0 1.5.2
path ^1.6.4 1.6.4
source_maps >=0.10.0+1 <1.0.0 0.10.8
Transitive dependencies
charcode 1.1.2
collection 1.14.12
meta 1.1.8
source_span 1.6.0
term_glyph 1.1.0
Dev dependencies
test any