Skip to content

[dart2wasm] Empty 'names' field in generated source maps #56718

Closed
@buenaflor

Description

@buenaflor

Environment

  • Dart 3.5.2
  • Flutter 3.24.2
  • macOS 14.4.1

Description

When building a project for web with wasm, the generated source map file has an empty "names" field. This won't allow mapping symbol names to stack frames, which hinders debugging capabilities.

I have checked this commit: 10742d9
which asserts the function name in the source_map_simple_test.dart so it should work (or at least used to work)

Maybe I'm also missing some setup detail.

Steps to Reproduce

Example 1: Flutter

  1. Create a new Flutter web project for example through Android Studio
  2. Run the command flutter build --wasm --source-maps
  3. Examine the generated main.dart.wasm.map file

Example 2: Dart

  1. Create a Dart Web project with dart create -t web mywebapp
  2. Compile WASM: dart compile wasm web/main.dart
  3. Examine the generated main.wasm.map file

Expected Behaviour

The "names" field in the main.dart.wasm.map file should contain symbol names that can be used to map to stack frames.

Actual Behaviour

The "names" field in the main.dart.wasm.map file is empty.

Example Sourcemap Snippet

{
  "version": 3,
  "sources": [
  	"... etc",
    "org-dartlang-sdk:///lib/_internal/wasm/lib/date_patch_patch.dart"
  ],
  "names": [],
  "mappings": [
	"... etc",
    "0r8BAuM+C,IAAd,EAAK,C,yBA4BvB,CACI,WAAF,CAAoB,WAAH,CAqE9B"
  ]
}

Metadata

Metadata

Assignees

Labels

area-dart2wasmIssues for the dart2wasm compiler.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions