Skip to content

[dart2wasm] Help to deal with minified errors from deployed apps #60711

Open
@mkustermann

Description

@mkustermann

The default of dart2wasm is now -O2, which is sound mode but does perform minification and stripping. When customers run into errors in production they may get errors and stack traces that aren't very useful, such as:

Got error: Instance of 'minified:Class100', stack:
    at wasm://wasm/000159de:wasm-function[189]:0x55e4
    at wasm://wasm/000159de:wasm-function[190]:0x563b
    at wasm://wasm/000159de:wasm-function[121]:0x4153
    at wasm://wasm/000159de:wasm-function[120]:0x40d6
    at app.mjs:111:49

Now the stack trace can be decoded using source maps (see #56232 for remaining items), the <obj.runtimeType>.toString() cannot.

The VM has similar situations with stripping symbolic information (emitting it as DWARF that isn't part of the deployed app) and obfuscating names. It has solved this by

  • exposing a NativeRuntime.buildId used to identify the exact deployed app version
  • having flutter symbolize to decode stack traces
  • writing an obfuscation map allowing users to map obfuscated names back to original names (see here)

We may also want to have some convenience utilities to help users deal with production errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart2wasmIssues for the dart2wasm compiler.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions