JS source maps issues

300 views
Skip to first unread message

Philippe Elsass

unread,
Jan 4, 2015, 3:17:32 PM1/4/15
to haxe...@googlegroups.com
Hello,

I'm trying to make source maps work better on Windows.

The general solution for now is to use (the somewhat secret) `-D source-map-content` flag which includes all the source into the map file. Works beautifully in Chrome, Firefox and IE11, but the map files become quite large and it probably negatively impacts build times.

Without the flag:

In Firefox 33+ it works with Haxe 3.0.1+ (\o/): browsing Haxe files, breakpoints, etc.

Sadly, IE11 and Chrome are not able to resolve the Haxe files, even using Haxe 3.2 nightly.
Both display the mapped file names but can't find the contents.

For Chrome I found out you are supposed to add the source folder to the "workspace" for our own "security". That effectively adds the files source, but it is not possible to add breakpoints and Chrome fails to link a JS breakpoint to the Haxe file like what happens when you have the source included in the map. 

I figured one thing though: renamed one .hx file to .js and changed the name in the map and suddenly I was able to add breakpoints and all, so it seems Chrome only recognize source maps for specific filetypes. Does anyone knows why?

--
Philippe

Jörg Wasmeier

unread,
Jan 8, 2015, 3:20:11 AM1/8/15
to haxe...@googlegroups.com
Haha thats funny because on my machine (MAC) the SourceMaps only work with Chrome / Safari :D

Mark Knol

unread,
Jan 8, 2015, 5:01:55 PM1/8/15
to haxe...@googlegroups.com
I hope there will be a solution for this, but i think this is a chrome related bug, because it does not load the map because of its own sandbox.

Philippe Elsass

unread,
Jan 9, 2015, 1:53:35 AM1/9/15
to haxe...@googlegroups.com

I have investigated a bit and the problem with Chrome (on Windows) is that it doesn't consider that Haxe files are "code":
https://code.google.com/p/chromium/issues/detail?id=446060

I hope there will be a solution for this, but i think this is a chrome related bug, because it does not load the map because of its own sandbox.

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Mark Knol

unread,
Jan 9, 2015, 6:12:07 AM1/9/15
to haxe...@googlegroups.com
Good CSI work Philippe ! Let's hope it gets fixed soon!

JeriX

unread,
Apr 22, 2015, 8:15:33 AM4/22/15
to haxe...@googlegroups.com
Thanks for pointing to "-D source-map-content" flag - it's working in Chrome 42 with this flag.
But it can't stop on breakpoint in any init code, says:
// Please wait a bit.
// Compiled script is not shown while source map is being loaded!
I understand I can start actual app on some user interaction but is there better solution?

And one more thing:
In Firefox 37 haxe code showed even without this "-D source-map-content" flag but breakpoints doesn't work :(
Anybody knows what may be the problem?

underscorediscovery

unread,
Apr 23, 2015, 4:44:00 AM4/23/15
to haxe...@googlegroups.com
The "please wait" is because it's booting megabytes of source details instead of the source map as a separate file that's it used to, so it just takes very long to process.

So far, aside from the (sometimes minutes) delay or mashing the reload key till it shows anything at all - they work mostly ok, breakpoints and all. I use it quite frequently.
The "normal" way, in the last few years, I have never coerced chrome to work. I also stumbled on the post with Philippe, and sighed.
It would be great if they didn't whitelist what they consider to be code, that defeats the entire purpose of source mapping.

Much worse problems arise when trying to search the source code, with these flags enabled.
Reloading the page with a search term already entered, can often crash the console, because it's got so much data in the source maps.

Philippe Elsass

unread,
Apr 23, 2015, 11:27:17 AM4/23/15
to haxe...@googlegroups.com
I raised an issue on Chromium about that a short while after posting to the mailing list (so that's a few months ago) and Google accepted this whitelist problem as a future enhancement.

Starring/bumping welcome ;)

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--
Philippe

JeriX

unread,
Apr 23, 2015, 11:38:56 AM4/23/15
to haxe...@googlegroups.com
"Starring/bumping welcome ;)"
Aha! I knew my numerous google accounts come in handy :D

Fernando Serboncini

unread,
Apr 23, 2015, 11:57:42 AM4/23/15
to haxe...@googlegroups.com
Oh, I glanced through this before and forgot to add to my todo list.
Just sent a chromium push and pinged some internal devs to try to fix this.
Stay tunned.

Fernando Serboncini

unread,
Apr 23, 2015, 4:57:19 PM4/23/15
to haxe...@googlegroups.com
Fixed!
It just landed on Chrome. It should be available on Chrome 44 and on canary much sooner than that.

If you guys can test on Chrome Canary next week it would be great.

:)
F.

Philippe Elsass

unread,
Apr 23, 2015, 5:05:24 PM4/23/15
to haxe...@googlegroups.com

Lovely, I see hx has been added to the known script langs - happy for Haxe, sorry for the next compile-to-JS language (I see mentions of livescript/ls in another ticket).

Hopefully this list becomes configurable in the future...

Fernando Serboncini

unread,
Apr 23, 2015, 5:32:07 PM4/23/15
to haxe...@googlegroups.com

The plan is to remove that weird dependency on the future, but I convinced them to just add haxe in the meantime.

Philippe Elsass

unread,
Apr 23, 2015, 5:34:39 PM4/23/15
to haxe...@googlegroups.com

Hero.

JeriX

unread,
Apr 23, 2015, 8:23:37 PM4/23/15
to haxe...@googlegroups.com
I've just intalled canary and it's working without this flag!

Fernando Serboncini

unread,
Apr 23, 2015, 8:52:25 PM4/23/15
to haxe...@googlegroups.com

:)

Sven Bergström

unread,
Apr 24, 2015, 6:07:31 AM4/24/15
to haxe...@googlegroups.com
Thanks Fernando, I'll test it out on all my stuff later.

If there isn't one, We should file a separate issue about the whitelist.
I think after all the explicit action required to get it showing the file in the first place, the whitelist may have been superseded for its purpose (if there was one).

:)

You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.

JLM

unread,
Apr 12, 2017, 6:09:50 AM4/12/17
to Haxe
Console log is not working under firefox nightly? but seems ok on firefox, I have tried asking about it on #nightly but no one seems to know, has anyone else tried firefox nightly just worried that future firefox will not have logging for haxe.
Reply all
Reply to author
Forward
0 new messages