2

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?

6
  • I don't think webstorm use pub serve when doing Open in browser -> Chrome. You can try to do right click index.html -> run index.html, it will open dartium, then copy/paste the url into chrome. Commented Jan 9, 2017 at 14:23
  • When running in browser, it shows the pub serve command and it launches the browser selected. Also when launching Dartium, that URL will not work in other browsers because it is running dart code in Dartium. For "run in browser" option, the code is compiled to js using dart2js before being hosted by pub serve. Commented Jan 9, 2017 at 15:30
  • The url will work, pub serve will automatically run pub build Commented Jan 9, 2017 at 15:32
  • @Hadrien - Confirmed you are right, the Dartium URL will work in Chrome. However, the source maps still don't work. In WebStorm, there is a Pub Serve console which shows launching "pub serve web". Commented Jan 9, 2017 at 21:16
  • This definitely looks like a WebStorm bug. I reproduced this and filed it with IntelliJ: youtrack.jetbrains.com/issue/WEB-25629 Commented Feb 24, 2017 at 23:44

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.