When using WebStorm to launch a sample project using the "Open in Browser" option, the source maps do not work correctly in Chrome. However, they load fine when running from command line.
For example, load the pirate_badge sample project in WebStorm, right click index.html and select Open in browser -> Chrome
. The browser will load the project. Inspect page and go to Sources -> localhost:<port> -> pirate_badge -> packages -> pirate_badge -> name_service.dart
. The file can be selected but the source window is blank. This is the same for all other sources.
When I run pub serve
or pub serve web
in the console and open in the browser manually (localhost:8080), the source maps load correctly and you can browse the dart sources and debug just fine.
Why would source maps not be working with WebStorm but working fine manually?
Workaround is to check 'Allow unsigned requests' in Preferences (Settings) | Build, Execution, Deployment | Debugger. The problem is tracked as https://youtrack.jetbrains.com/issue/WEB-25629.