Repository navigation
[flutter_tools] Include flutter.js.map in web builds - #192257
Merged
auto-submit[bot] merged 3 commits intoSep 29, 2026
Merged
Conversation
The prebuilt Flutter loader always references flutter.js.map, but web builds only copied flutter.js from the web SDK. This left browsers requesting a source map that was absent from build/web. Declare the loader source map as a WebBuiltInAssets output and copy it alongside flutter.js. Add a unit test covering both the output declaration and copied contents. Fixes flutter#145111
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates WebBuiltInAssets to declare and copy the Flutter loader source map (flutter.js.map) alongside flutter.js, and adds a corresponding test to verify this behavior. Feedback suggests refactoring the file copying loop in web.dart to use more generic variable names and consistently use childFile for path resolution to improve readability.
mdebbar
approved these changes
Sep 29, 2026
mdebbar
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Thanks for contributing this fix!
This was referenced Sep 30, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Sep 30, 2026
flutter/flutter@55b8f88...d649d2b 2026-09-30 [email protected] [Android] Update the CLI to reject passing engine configuration flags with a prebuilt binary in release mode (flutter/flutter#190870) 2026-09-30 [email protected] Roll Skia from af1e8b356dd1 to c7b323126bf0 (1 revision) (flutter/flutter#193569) 2026-09-30 [email protected] [web] Respect text affinity in getLineBoundary at a soft wrap (flutter/flutter#192664) 2026-09-30 [email protected] [tool] Migrate TestCommand and platform runner to modular dependency injection (flutter/flutter#190789) 2026-09-30 [email protected] Roll Skia from 3a20a0464d25 to af1e8b356dd1 (1 revision) (flutter/flutter#193564) 2026-09-30 [email protected] Roll Skia from 554ef62d11a9 to 3a20a0464d25 (6 revisions) (flutter/flutter#193556) 2026-09-30 [email protected] Use null aware elements in `platform_views.dart` (flutter/flutter#193214) 2026-09-30 [email protected] Replace deprecated `withOpacity` in `flutter_logo.dart` (flutter/flutter#192583) 2026-09-30 [email protected] Roll Skia from f441ca223b2b to 554ef62d11a9 (72 revisions) (flutter/flutter#193548) 2026-09-30 [email protected] Fix StrcmpFixed matching prefixes in the Vulkan embedder tests (flutter/flutter#192999) 2026-09-30 [email protected] Update Engine to test Android 17 AVD (flutter/flutter#193239) 2026-09-29 [email protected] Give the Vulkan test context the extensions Impeller requires (flutter/flutter#193002) 2026-09-29 [email protected] Rename "subtext" to "supportingTextPadding" in `FormField`'s documentation (flutter/flutter#183582) 2026-09-29 [email protected] Set --no-js-strongly-connected-components for DDC compiles by default (flutter/flutter#193485) 2026-09-29 [email protected] Split pre-AGP 8.3 module AAR test into a Java 17 pinned target (flutter/flutter#193467) 2026-09-29 [email protected] Remove no-shuffle from gen_defaults_test (flutter/flutter#192280) 2026-09-29 [email protected] Update guidance on bumping Dart (flutter/flutter#193131) 2026-09-29 [email protected] Remove vestigial `download_jdk` gclient var (flutter/flutter#188571) 2026-09-29 [email protected] Roll pub packages (flutter/flutter#193522) 2026-09-29 [email protected] [flutter_tools] Lazily initialize AndroidSdk platform and build-tools discovery (flutter/flutter#191972) 2026-09-29 [email protected] [tool] Migrate Web build subcommands and toolchain to modular dependency injection (flutter/flutter#190783) 2026-09-29 [email protected] Pin androidx.test dependencies in integration_test (flutter/flutter#193316) 2026-09-29 [email protected] [flutter_tools] Include flutter.js.map in web builds (flutter/flutter#192257) 2026-09-29 [email protected] [WebParagraph] Fixing edge cases for wrapping text (with newlines) (flutter/flutter#189858) 2026-09-29 [email protected] Bump customer testing version for flutter/devtools update (flutter/flutter#193511) 2026-09-29 [email protected] Roll Packages from ba0364a to 3c6ce59 (14 revisions) (flutter/flutter#193507) 2026-09-29 [email protected] [flutter_tools] Guard socket streams and done futures against socket reset errors (flutter/flutter#192941) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The prebuilt Flutter web loader ends with a reference to
flutter.js.map. The matching source map is already part of the Flutter web SDK, butWebBuiltInAssetsonly copiesflutter.jsand CanvasKit intobuild/web. As a result, browser developer tools request a file that is missing from every web build, and tools such as error reporters cannot resolve stack frames from the loader.This change declares
flutter.js.mapas a built-in web output and copies it alongsideflutter.js.The copy is intentionally independent of
--[no-]source-maps. That option controls source maps produced while compiling the application, whileflutter.jsis a prebuilt SDK artifact that always references its own prebuilt map.Fixes #145111.
Validation
./bin/dart --enable-asserts dev/bots/analyze.dart../../bin/dart test test/general.shard/build_system/targets/web_test.dart(626 tests)bin/flutter-dev build webbuild/web/flutter.js.mapbin/flutter-dev build web --source-mapsbin/flutter-dev build web --wasmNo changes to
flutter/testsare required.Pre-launch Checklist
///).