Skip to content

Javascript source maps does not work #143703

@woprandi

Description

@woprandi

Steps to reproduce

  1. Create new app
  2. Add throw Exception("test") somewhere
  3. Build on web with --source-maps flag
  4. cd build/web
  5. Test locally python -m http.server for example

Expected results

Original Dart code stack trace

Actual results

Minified Javascript code stack trace

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    throw Exception("test");
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
       colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const Text("test"),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

image

Javascript source maps is enabled on Chrome
image

Logs

Logs

main.dart.js.map is correctly generated and loaded by browser

Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /flutter.js HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] code 404, message File not found
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /flutter.js.map HTTP/1.1" 404 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /manifest.json HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /favicon.png HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /main.dart.js HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /icons/Icon-192.png HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /main.dart.js.map HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /assets/FontManifest.json HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /assets/fonts/MaterialIcons-Regular.otf HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /assets/packages/cupertino_icons/assets/CupertinoIcons.ttf HTTP/1.1" 200 -
127.0.0.1 - - [19/Feb/2024 14:00:16] code 404, message File not found
127.0.0.1 - - [19/Feb/2024 14:00:16] "GET /main.dart HTTP/1.1" 404 -

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.0, on Fedora Linux 39 (Workstation Edition) 6.7.4-200.fc39.x86_64, locale fr_FR.UTF-8)
    • Flutter version 3.19.0 on channel stable at /home/william/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision bae5e49bc2 (il y a 5 jours), 2024-02-13 17:46:18 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/william/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/william/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 17.0.6 (Fedora 17.0.6-2.fc39)
    • cmake version 3.27.7
    • ninja version 1.11.1
    • pkg-config version 1.9.5

[✓] Android Studio (version 2023.1)
    • Android Studio at /home/william/.local/share/JetBrains/Toolbox/apps/android-studio
    • Flutter plugin version 77.1.2
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] IntelliJ IDEA Community Edition (version 2023.3)
    • IntelliJ at /home/william/.local/share/JetBrains/Toolbox/apps/intellij-idea-community-edition
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.86.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.82.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Fedora Linux 39 (Workstation Edition) 6.7.4-200.fc39.x86_64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 121.0.6167.184

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listfound in release: 3.19Found to occur in 3.19found in release: 3.20Found to occur in 3.20has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions