Skip to content

Consider including flutter.js.map in the build output folder #145111

Closed

Description

@eyebrowsoffire

Since we include flutter.js in the output build directory, it might be worthwhile to also include flutter.js.map by default.

Activity

  1. added
    in triagePresently being triaged by the triage team
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-webWeb applications specifically
    c: proposalA detailed proposal for a change to Flutter
    a: buildBuilding flutter applications with the tool
    team-webOwned by Web platform team
    and removed
    in triagePresently being triaged by the triage team
    on Mar 14, 2024
  2. added
    P2Important issues not at the top of the work list
    triaged-webTriaged by Web platform team
    on Mar 21, 2024
  3. henryqum commented on Jul 15, 2024

    @henryqum

    Hi, my flutter web app break on safari because it can't load flutter.js.map, i get Failed to load resource: the server responded with a status of 404 (), the browser manage to load all other files

  4. BenBroide commented on Jul 18, 2024

    @BenBroide

    Same issue. Web app breaks on mobile browsers, even when adding flags flutter build web --release --source-maps the file flutter.js.map is not generated

  5. BenBroide commented on Jul 18, 2024

    @BenBroide

    Hi, my flutter web app break on safari because it can't load flutter.js.map, i get Failed to load resource: the server responded with a status of 404 (), the browser manage to load all other files

    Could be something else is breaking your web app but the only error is the .map file error
    In my case something else was breaking the app.
    You can try by setting a placeholder map file and see which errors you have after

  6. henryqum commented on Jul 18, 2024

    @henryqum

    In my case something else was breaking the app.

    could be, what broke your app?

  7. BenBroide commented on Jul 18, 2024

    @BenBroide

    In my case something else was breaking the app.

    could be, what broke your app?

    I moved some variables to a .env file and did not adjust git actions to set them while deploying.
    Try to set this in your app as placeholder and see which error show up in console once the .map file error will be gone. The error will probably not show the exact code since it's not a real .map file

    flutter.js.map

    {
        "version": 3,
        "file": "flutter.js",
        "sources": [],
        "names": [],
        "mappings": ""
      }
    
  8. henryqum commented on Jul 18, 2024

    @henryqum

    @BenBroide Sure, I'll try that. Thanks for your suggestion.

  9. olof-dev commented on Nov 14, 2024

    @olof-dev
    Contributor

    It seems like {{flutter_js}} in index.html includes a line

    //# sourceMappingURL=flutter.js.map
    

    at the end. Since that file isn't provided automatically, it'll most likely show up as a console warning in many browsers.

    This happens regardless of whether --no-source-maps is specified in flutter build web. If the resolution of this issue is to include the source map automatically, should it be regardless of --[no-]source-maps?

  10. tbecker commented on Feb 5, 2025

    @tbecker

    I use flutter 3.27 and have the same issue, when using the developer tools in Chrome, Safari, Firefox on Mac Sequioa 15.2

    I run build with --source-maps

    I receive the following error message from the python http server
    ::1 - - [05/Feb/2025 10:36:05] code 404, message File not found
    ::1 - - [05/Feb/2025 10:36:05] "GET /flutter.js.map HTTP/1.1" 404 -

    While main.dart.js.map is available, flutter.js.map is missing in the build/web directory. Again, the error is only relevant when using the developer Javascript tools, not in normal mode.

  11. PascalHaupt commented on Feb 26, 2025

    @PascalHaupt

    Is there any update on this? We need the mappings (flutter.js.map) for sentry. Even when configuring sentry to upload the sources also, the stack trace still isn't useful.

    It seems that the mapping file flutter.js.map won't be created at all. I can't find it anywhere in my entire project folder. For building I use the command flutter build web --source-maps. Currently, we are using flutter 3.27.0 but double checked the current version too (as of time of writing this is 3.29.0). We even tested it with an empty, newly created flutter project and got the same result.

    Since we include flutter.js in the output build directory, it might be worthwhile to also include flutter.js.map by default.

    Does this mean the mapping file can be grabbed from somewhere? If so, where can one find it? A viable workarounf for now could be to copy this file manually into the build/web directory.

  12. Goshagosha commented on Mar 11, 2025

    @Goshagosha

    Does this mean the mapping file can be grabbed from somewhere? If so, where can one find it? A viable workarounf for now could be to copy this file manually into the build/web directory.

    Facing same issue as you, with the need to upload maps to sentry, I found that maps can be found at $FLUTTER_HOME/bin/cache/flutter_web_sdk/flutter_js/flutter.js.map

    Copying them manually for now, but it really would make sense, if --source-maps flag did this automatically

  13. DarioCorno commented on Jan 15, 2026

    @DarioCorno

    Any updat on this one? Latest flutter release still doesn't properly generate flutter.js.map and breaks mobile Safari

  14. added a commit that references this issue on Sep 29, 2026
    1e847f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolc: proposalA detailed proposal for a change to Flutterplatform-webWeb applications specificallyteam-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