flutter / flutter/devtools

Stack traces are obfuscated

Open
#8,627 4 comments 2 reactions 0 assignees View on GitHub
dart2wasm P1 product-quality
Dominant language
Dart
Stars
1.7k
Forks
404
Avg merge
6d 17h
Merged PRs (30d)
18

Description

In https://github.com/Dart-Code/Dart-Code/pull/5367#issuecomment-2532490346 I noted the stack traces for some errors were not very useful because of minification/wasm. After discussing with @kenzieschmoll we believed this might be VS Code-specific so to try and compare I checked what I'm getting outside of DevTools.

I can't repro the same issue, however I can force the kind of error noted at https://github.com/Dart-Code/Dart-Code/issues/5158#issuecomment-2497856004 by just running:

```
dt serve --dtd-uri ws://localhost:1234/invalid
```

When using WASM, this is what I see:

![image](https://github.com/user-attachments/assets/408e70ca-c2fa-4ac8-8cfa-7f0a028164be)

It's not clear to me if this is expected or not. There are some `.dart` files and line numbers in the call stack, but there are also some `main.dart.wasm` with hex offsets and all of the function names are obfuscated.

If I do the same without WASM, the function names are all still obfuscated although the top of the stack has some extra filenames that weren't in the wasm version (for example `logger_helpers.dart:34`).

![image](https://github.com/user-attachments/assets/52a6c6d6-9da9-4c19-92fe-4700a66a6637)

I'm not certain that this is wrong, but the screenshots from @elliette at https://github.com/Dart-Code/Dart-Code/issues/5158#issuecomment-2504607675 seem like they have much better information than here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.