I can’t open source files from my browsers anymore. I don’t know why. It stops working something like 2 weeks ago. It seems that all my browsers are affected (all Chromium based, I even tried on a second PC).
When I open the devtools, I can see all the sources files on the page panel on the left but when I try to open one file by clicking on it or by pressing CTRL + P, this is what I got:
I’ve checked the .map file and I can see "sourceRoot":"file:///", so the URL of the files should be file:///C:/HaxeToolkit/haxe/lib/lime/7,8,0/src/haxe/io/Bytes.hx and not with localhost prefix. Am I correct?
I think it’s related to a browser update and not openfl, but any help appreciated, thanks.
What can I do to fix that? I’m becoming crazy without sourcemaps
In @gonzos devtools, we can see that source files are in the file:// directory. But in mine, they are under the localhost:2000 directory (despite the "sourceRoot":"file:///" rule in the .map file)
I have also tested Chromium 79, and it works! So for now I can use that to debug my projects but I need to find a solution to debug on up to date browers (browsers not working : chrome, opera, edge, firefox).
So I’ve just downloaded Chromium Version 100.0.4896.0 (Build de développement) (64 bits) which is supposed to be older that your version @gonzos and it doesn’t work (I have not found your specific version). What the heck is wrong?
I have downloaded and tested Chromium Version 96.0.4664.0 (Build de développement) (64 bits) and it works. So I can stick around with this version for a little while waiting for a fix.
Also I’ve found a workaround by adding in the .map file file:/// in each path in the sources variable. E.g: "sources":["file:///C:/HaxeToolkit/haxe/lib/lime/7,8,0/src/lime/app/Module.hx",...
So this could be needed in openfl if the Chromium team doesn’t provide any fix.
I think that source maps are generated by the Haxe compiler, so if any fix is needed, it will probably be there.
Which version of Haxe are you using? Maybe the source maps are generated somewhat differently by different versions of Haxe.
For instance, I am using Haxe 4.2.5, and I just did a fresh compile for html5 -debug. I see an empty "sourceRoot":"" in my .map file. Additionally, all paths listed in "sources" start with file:///. I didn’t need to add that manually, like you mentioned you had to do. It was already like that.
For the record again, for Chromium version 96 I pasted “929513” as the filter (Branch Base Position). For users in the world who need to enable the “Override software rendering list” flag in Mac OS 10.13 (probably just me), it doesn’t behave properly in Chromium 96, but 79 does work.
It supposed to be fixed in recent Chromium commit but still not built so we need to wait (I have filled an issue to Chromium team). I’ll try to check by compiling Chromium if I have the time.
Firefox v110.0.1, source maps don’t work. As a workaround -D source-map-content can be used (it will embed content of all used .hx files into .js.map file).