Flutter Web: No Source Maps, Can't Debug
Asked Answered
K

0

6

I've run into a problem and I'm stuck.

I deploy my flutter web app to firebase hosting and I am trying to use chrome://inspect dev tools to debug.

I get an error that is only happening on flutter web, but the references in the error logs all point to main.dart.js which is the minified/compiled JS file.

I need to see where in the Dart code these errors are happening so I can fix them but for some reason I can't get source maps to work at all.

I even tried deploying to local network, to a firebase hosting preview channel and to the main site, and using the --source-maps flag when building in each scenario, but still I don't see any references to my Dart code, nor can I find any solid documentation around this process, official or otherwise.

Can anyone please give some guidance?

Below are the commands I've tried to use to build but none have the source maps. Also, I've included some images of the errors and where they point to in chrome dev tools. You can view them here.

Thanks!

Build commands:

  • flutter run -d web-server --web-hostname {IP-ADDRESS} --web-port 8080 --web-renderer html
  • flutter run -d web-server --web-hostname {IP-ADDRESS} --web-port 8080 --web-renderer html --source-maps
  • flutter build web --release --source-maps
  • flutter build web --release --web-renderer html --source-maps
  • flutter build web --web-renderer html --release --source-maps && firebase hosting:channel:deploy my-html-test-channel
  • flutter build web --web-renderer html --release --source-maps && firebase deploy --only hosting
Kalmar answered 29/1 at 18:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.