You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider including flutter.js.map in the build output folder #145111
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
Reacted by Alejandro, dmitry-kotorov, Nikita Mishkov and Shannon Heylmun
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
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
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
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?
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.
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.
Reacted by egor-gb, Gideon Lapshun and Shannon Heylmun
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
Reacted by Raimund Pock, Baptiste Seux, Matej Hočevar, Julián Suárez, Syles, EmreDET, fusion44, Shannon Heylmun and Luccas Clezar
Activity
henryqum commentedon Jul 15, 2024
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
BenBroide commentedon Jul 18, 2024
Same issue. Web app breaks on mobile browsers, even when adding flags
flutter build web --release --source-mapsthe fileflutter.js.mapis not generatedBenBroide commentedon Jul 18, 2024
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
henryqum commentedon Jul 18, 2024
could be, what broke your app?
BenBroide commentedon Jul 18, 2024
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.maphenryqum commentedon Jul 18, 2024
@BenBroide Sure, I'll try that. Thanks for your suggestion.
olof-dev commentedon Nov 14, 2024
It seems like
{{flutter_js}}inindex.htmlincludes a lineat 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-mapsis specified influtter build web. If the resolution of this issue is to include the source map automatically, should it be regardless of--[no-]source-maps?tbecker commentedon Feb 5, 2025
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.
PascalHaupt commentedon Feb 26, 2025
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.mapwon't be created at all. I can't find it anywhere in my entire project folder. For building I use the commandflutter 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.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.
Goshagosha commentedon Mar 11, 2025
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.mapCopying them manually for now, but it really would make sense, if
--source-mapsflag did this automaticallyDarioCorno commentedon Jan 15, 2026
Any updat on this one? Latest flutter release still doesn't properly generate flutter.js.map and breaks mobile Safari
[flutter_tools] Include flutter.js.map in web builds (flutter#192257)